You are here

public function SimplesitemapTest::testRemoveDuplicatesSetting in Simple XML sitemap 8.3

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

Tests the duplicate setting.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

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

Class

SimplesitemapTest
Tests Simple XML Sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

public function testRemoveDuplicatesSetting() {
  $this->generator
    ->setBundleSettings('node', 'page')
    ->addCustomLink('/node/1')
    ->saveSetting('remove_duplicates', TRUE)
    ->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
  $this
    ->drupalGet($this->defaultSitemapUrl);
  $this
    ->assertUniqueTextWorkaround('node/' . $this->node
    ->id());
  $this->generator
    ->saveSetting('remove_duplicates', FALSE)
    ->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
  $this
    ->drupalGet($this->defaultSitemapUrl);
  $this
    ->assertNoUniqueTextWorkaround('node/' . $this->node
    ->id());
}