You are here

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

Test enabling sitemap support for an entity type.

@todo Test admin/config/search/simplesitemap/entities form.

Throws

\Drupal\Component\Plugin\Exception\PluginException

\Behat\Mink\Exception\ExpectationException

File

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

Class

SimplesitemapTest
Tests Simple XML Sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

public function testEnableEntityType() {
  $this->generator
    ->disableEntityType('node')
    ->enableEntityType('node')
    ->setBundleSettings('node', 'page');
  $this
    ->drupalLogin($this->privilegedUser);
  $this
    ->drupalGet('admin/structure/types/manage/page');
  $this
    ->assertSession()
    ->pageTextContains('Simple XML Sitemap');
  $this->generator
    ->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
  $this
    ->drupalGet($this->defaultSitemapUrl);
  $this
    ->assertSession()
    ->responseContains('node/' . $this->node
    ->id());
  $this
    ->assertTrue($this->generator
    ->entityTypeIsEnabled('node'));
}