You are here

public function QueuerAddFormTest::testAddPresence in Purge 8.3

Tests that the right queuers are listed on the form.

See also

\Drupal\purge_ui\Form\QueuerAddForm::buildForm

\Drupal\purge_ui\Form\CloseDialogTrait::addPurger

File

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

Class

QueuerAddFormTest
Tests \Drupal\purge_ui\Form\QueuerAddForm.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testAddPresence() : void {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->initializeQueuersService([
    'a',
    'b',
  ]);
  $this
    ->assertSession()
    ->responseContains('Add');
  $this
    ->assertSession()
    ->responseNotContains('Queuer A');
  $this
    ->assertSession()
    ->responseNotContains('Queuer B');
  $this
    ->assertSession()
    ->responseContains('Queuer C');
  $this
    ->assertSession()
    ->responseContains('Queuer with form');
  $this
    ->assertSame(TRUE, count($this->purgeQueuers
    ->getPluginsEnabled()) === 2);
  $this
    ->assertSame(TRUE, in_array('a', $this->purgeQueuers
    ->getPluginsEnabled()));
  $this
    ->assertSame(TRUE, in_array('b', $this->purgeQueuers
    ->getPluginsEnabled()));
  $this
    ->assertSame(FALSE, in_array('c', $this->purgeQueuers
    ->getPluginsEnabled()));
  $this
    ->assertSame(FALSE, in_array('withform', $this->purgeQueuers
    ->getPluginsEnabled()));
}