protected function TestBase::verbose

Logs verbose message in a text file.

The a link to the vebose message will be placed in the test results via as a passing assertion with the text '[verbose message]'.

Parameters

$message: The verbose message to be stored.

See also

simpletest_verbose()

19 calls to TestBase::verbose()
FilterUnitTest::assertFilteredString in drupal/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
Asserts multiple filter output expectations for multiple input strings.
FilterUnitTest::testLineBreakFilter in drupal/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
Tests the line break filter.
HtmlToTextTest::assertHtmlToText in drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
Helper function for testing drupal_html_to_text().
HtmlToTextTest::testDrupalHtmlToTextBlockTagToNewline in drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
Test that text separated by block-level tags in HTML get separated by (at least) a newline in the plaintext version.
LinkFieldTest::renderTestEntity in drupal/core/modules/field/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php
Renders a test_entity and sets the output in the internal browser.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php, line 612
Definition of Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function verbose($message) {

  // Do nothing if verbose debugging is disabled.
  if (!$this->verbose) {
    return;
  }
  $message = '<hr />ID #' . $this->verboseId . ' (<a href="' . $this->verboseClassName . '-' . ($this->verboseId - 1) . '.html">Previous</a> | <a href="' . $this->verboseClassName . '-' . ($this->verboseId + 1) . '.html">Next</a>)<hr />' . $message;
  $verbose_filename = $this->verboseDirectory . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';
  if (file_put_contents($verbose_filename, $message, FILE_APPEND)) {
    $url = $this->verboseDirectoryUrl . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';

    // Not using l() to avoid invoking the theme system, so that unit tests
    // can use verbose() as well.
    $url = '<a href="' . $url . '" target="_blank">' . t('Verbose message') . '</a>';
    $this
      ->error($url, 'User notice');
  }
  $this->verboseId++;
}