You are here

public function SimplesitemapTest::testInitialGeneration in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testInitialGeneration()
  2. 4.x tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testInitialGeneration()

Verify sitemap.xml has the link to the front page after first generation.

File

tests/src/Functional/SimplesitemapTest.php, line 17

Class

SimplesitemapTest
Tests Simple XML sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

public function testInitialGeneration() {
  $this->generator
    ->generateSitemap('nobatch');
  $this
    ->drupalGet('sitemap.xml');
  $this
    ->assertSession()
    ->responseContains('urlset');
  $this
    ->assertSession()
    ->responseContains(Url::fromRoute('<front>')
    ->setAbsolute()
    ->toString());
  $this
    ->assertSession()
    ->responseContains('1.0');
  $this
    ->assertSession()
    ->responseContains('daily');
}