You are here

public function QueuerAddFormTest::testRouteConditionalAccess in Purge 8.3

Tests that the form route is only accessible under the right conditions.

File

modules/purge_ui/tests/src/Functional/Form/QueuerAddFormTest.php, line 37

Class

QueuerAddFormTest
Tests \Drupal\purge_ui\Form\QueuerAddForm.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testRouteConditionalAccess() : void {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->initializeQueuersService([
    'a',
    'b',
    'c',
  ]);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->initializeQueuersService([
    'a',
    'b',
    'c',
    'withform',
    'purge_ui_block_queuer',
  ]);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->statusCodeEquals(404);
}