public function SimplesitemapTest::testEnableEntityType in Simple XML sitemap 8.2
Same name and namespace in other branches
- 8.3 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testEnableEntityType()
- 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.
File
- tests/
src/ Functional/ SimplesitemapTest.php, line 460
Class
- SimplesitemapTest
- Tests Simple XML sitemap functional integration.
Namespace
Drupal\Tests\simple_sitemap\FunctionalCode
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('nobatch');
$this
->drupalGet('sitemap.xml');
$this
->assertSession()
->responseContains('node/' . $this->node
->id());
$this
->assertTrue($this->generator
->entityTypeIsEnabled('node'));
}