public function SitemapTest::testSitemap in Sitemap 2.0.x
Same name and namespace in other branches
- 8.2 src/Tests/SitemapTest.php \Drupal\sitemap\Tests\SitemapTest::testSitemap()
Test user access and page locations.
File
- src/
Tests/ SitemapTest.php, line 15
Class
- SitemapTest
- Tests the routes provided by the sitemap module.
Namespace
Drupal\sitemap\TestsCode
public function testSitemap() {
// Find the Sitemap page at /sitemap.
$this
->drupalLogin($this->userView);
$this
->drupalGet('/sitemap');
$this
->assertResponse('200');
// Unauthorized users cannot view the sitemap.
$this
->drupalLogin($this->userNoAccess);
$this
->drupalGet('/sitemap');
$this
->assertResponse('403');
}