You are here

protected function XmlSitemapTestBase::verbose in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/XmlSitemapTestBase.php \Drupal\Tests\xmlsitemap\Functional\XmlSitemapTestBase::verbose()

Log verbose message in a text file.

This is a copy of DrupalWebTestCase->verbose() but allows a customizable summary message rather than hard-coding 'Verbose message'.

@todo Remove when https://www.drupal.org/node/800426 is fixed.

Parameters

string $verbose_message: The verbose message to be stored.

string $message: Message to display.

Overrides AssertLegacyTrait::verbose

See also

simpletest_verbose()

1 call to XmlSitemapTestBase::verbose()
XmlSitemapTestBase::assertNoWatchdogErrors in tests/src/Functional/XmlSitemapTestBase.php
Check that there were no watchdog errors or worse.

File

tests/src/Functional/XmlSitemapTestBase.php, line 512

Class

XmlSitemapTestBase
Helper test class with some added functions for testing.

Namespace

Drupal\Tests\xmlsitemap\Functional

Code

protected function verbose($verbose_message, $message = 'Verbose message') {
  if ($id = parent::verbose($verbose_message)) {
    $url = file_create_url($this->originalFileDirectory . '/simpletest/verbose/' . get_class($this) . '-' . $id . '.html');
    $message_url = Url::fromUri($url, [
      'attributes' => [
        'target' => '_blank',
      ],
    ]);
    $this
      ->error(\Drupal::linkGenerator()
      ->generate($message, $message_url), 'User notice');
  }
}