You are here

public function SitemapTest::testSitemap in Sitemap 8.2

Same name and namespace in other branches
  1. 2.0.x 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\Tests

Code

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');
}