You are here

public function SimplesitemapTest::testRemoveDuplicatesSetting in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testRemoveDuplicatesSetting()
  2. 8.2 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 298

Class

SimplesitemapTest
Tests Simple XML Sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

public function testRemoveDuplicatesSetting() {
  $this->generator
    ->entityManager()
    ->setBundleSettings('node', 'page');
  $this->generator
    ->customLinkManager()
    ->add('/node/1');
  $this->generator
    ->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());
}