You are here

public function SitemapTest::testSitemapAdmin in Sitemap 8.2

Same name and namespace in other branches
  1. 2.0.x src/Tests/SitemapTest.php \Drupal\sitemap\Tests\SitemapTest::testSitemapAdmin()

Test user access and page locations for administrators.

File

src/Tests/SitemapTest.php, line 32

Class

SitemapTest
Tests the routes provided by the sitemap module.

Namespace

Drupal\sitemap\Tests

Code

public function testSitemapAdmin() {

  // Find the Sitemap settings page.
  $this
    ->drupalLogin($this->userAdmin);
  $this
    ->drupalGet('/admin/config/search/sitemap');
  $this
    ->assertResponse('200');

  // Unauthorized users cannot view the sitemap.
  $this
    ->drupalLogin($this->userView);
  $this
    ->drupalGet('/admin/config/search/sitemap');
  $this
    ->assertResponse('403');
}