public function SimplesitemapTest::testAtomicEntityIndexation in Simple XML sitemap 4.x
Same name and namespace in other branches
- 8.3 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testAtomicEntityIndexation()
Test indexing an atomic entity (here: a user)
File
- tests/
src/ Functional/ SimplesitemapTest.php, line 479
Class
- SimplesitemapTest
- Tests Simple XML Sitemap functional integration.
Namespace
Drupal\Tests\simple_sitemap\FunctionalCode
public function testAtomicEntityIndexation() {
$user_id = $this->privilegedUser
->id();
$this->generator
->entityManager()
->setBundleSettings('user');
$this->generator
->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
$this
->drupalGet($this->defaultSitemapUrl);
$this
->assertSession()
->responseNotContains('user/' . $user_id);
user_role_grant_permissions('anonymous', [
'access user profiles',
]);
drupal_flush_all_caches();
//todo Not pretty.
$this->generator
->generateSitemap(QueueWorker::GENERATE_TYPE_BACKEND);
$this
->drupalGet($this->defaultSitemapUrl);
$this
->assertSession()
->responseContains('user/' . $user_id);
}