You are here

public function PageLoadProgressAdminSettingsTest::testAdminPages in Page Load Progress 8

Test menu link and permissions.

File

tests/src/Functional/PageLoadProgressAdminSettingsTest.php, line 64

Class

PageLoadProgressAdminSettingsTest
Tests for the page_load_progress module's admin settings.

Namespace

Drupal\Tests\page_load_progress\Functional

Code

public function testAdminPages() {

  // Verify admin link.
  $this
    ->drupalGet(Url::fromRoute('system.admin_config_ui'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Page Load Progress');

  // Verify route is valid.
  $this
    ->drupalGet(Url::fromRoute('page_load_progress.admin_settings'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Verify that there's no access bypass.
  $this
    ->drupalLogout();
  $this
    ->drupalGet(Url::fromRoute('system.admin_config_ui'));
  $this
    ->assertSession()
    ->statusCodeEquals(403);
}