You are here

public function DashboardTestBase::testFormAccess in Purge 8.3

Test if the form is at its place and has the right permissions.

File

modules/purge_ui/tests/src/Functional/DashboardTestBase.php, line 46

Class

DashboardTestBase
Testbase for tests testing \Drupal\purge_ui\Controller\DashboardController.

Namespace

Drupal\Tests\purge_ui\Functional

Code

public function testFormAccess() : void {
  $this
    ->drupalGet($this->route);
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this->route);
  $this
    ->assertSession()
    ->responseContains('When content on your website changes, your purge setup will take care of refreshing external caching systems and CDNs.');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}