You are here

public function SimplesitemapTest::testDisableEntityType 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::testDisableEntityType()
  2. 8.2 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testDisableEntityType()

Test disabling sitemap support for an entity type.

Throws

\Drupal\Component\Plugin\Exception\PluginException

\Behat\Mink\Exception\ExpectationException

File

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

Class

SimplesitemapTest
Tests Simple XML Sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

public function testDisableEntityType() {
  $this->generator
    ->entityManager()
    ->setBundleSettings('node', 'page')
    ->disableEntityType('node');
  $this
    ->drupalLogin($this->privilegedUser);
  $this
    ->drupalGet('admin/structure/types/manage/page');
  $this
    ->assertSession()
    ->pageTextNotContains('Simple XML Sitemap');
  $this->generator
    ->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
  $this
    ->drupalGet($this->defaultSitemapUrl);
  $this
    ->assertSession()
    ->responseNotContains('node/' . $this->node
    ->id());
  $this
    ->assertFalse($this->generator
    ->entityManager()
    ->entityTypeIsEnabled('node'));
}