public function SimplesitemapTest::testMaxLinksSetting in Simple XML sitemap 8.3
Same name and namespace in other branches
- 8.2 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testMaxLinksSetting()
- 4.x tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testMaxLinksSetting()
Test max links setting and the sitemap index.
Throws
\Drupal\Component\Plugin\Exception\PluginException
\Behat\Mink\Exception\ExpectationException
File
- tests/
src/ Functional/ SimplesitemapTest.php, line 328
Class
- SimplesitemapTest
- Tests Simple XML Sitemap functional integration.
Namespace
Drupal\Tests\simple_sitemap\FunctionalCode
public function testMaxLinksSetting() {
$this->generator
->setBundleSettings('node', 'page')
->saveSetting('max_links', 1)
->removeCustomLinks()
->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
$this
->drupalGet($this->defaultSitemapUrl);
$this
->assertSession()
->responseContains('sitemap.xml?page=1');
$this
->assertSession()
->responseContains('sitemap.xml?page=2');
$this
->drupalGet('sitemap.xml', [
'query' => [
'page' => 1,
],
]);
$this
->assertSession()
->responseContains('node/' . $this->node
->id());
$this
->assertSession()
->responseContains('0.5');
$this
->assertSession()
->responseNotContains('node/' . $this->node2
->id());
$this
->drupalGet('sitemap.xml', [
'query' => [
'page' => 2,
],
]);
$this
->assertSession()
->responseContains('node/' . $this->node2
->id());
$this
->assertSession()
->responseContains('0.5');
$this
->assertSession()
->responseNotContains('node/' . $this->node
->id());
}