You are here

public function ProcessorAddFormTest::testAddPresence in Purge 8.3

Tests that the right processors are listed on the form.

See also

\Drupal\purge_ui\Form\ProcessorAddForm::buildForm

\Drupal\purge_ui\Form\CloseDialogTrait::addPurger

File

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

Class

ProcessorAddFormTest
Tests \Drupal\purge_ui\Form\ProcessorAddForm.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

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