You are here

public function XmlSitemapEnginesFunctionalTest::testPing in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php \Drupal\Tests\xmlsitemap_engines\Functional\XmlSitemapEnginesFunctionalTest::testPing()

Check if ping works.

File

xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php, line 131

Class

XmlSitemapEnginesFunctionalTest
Test xmlsitemap_engines functionality.

Namespace

Drupal\Tests\xmlsitemap_engines\Functional

Code

public function testPing() {
  $edit = [
    'engines[simpletest]' => TRUE,
  ];
  $this
    ->drupalPostForm('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration'));
  $this
    ->assertSession()
    ->pageTextContains(t('The configuration options have been saved.'));
  $this
    ->submitEngines();
  $this
    ->assertWatchdogMessage([
    'type' => 'xmlsitemap',
    'message' => 'Submitted the sitemap to %url and received response @code.',
  ]);
  $this
    ->assertWatchdogMessage([
    'type' => 'xmlsitemap',
    'message' => 'Received ping for @sitemap.',
  ]);
}