You are here

public function PurgerAddFormTest::testTwoAvailablePurgers in Purge 8.3

Tests the 'plugin_id' form element for listing only available purgers.

See also

\Drupal\purge_ui\Form\PurgerAddForm::buildForm

File

modules/purge_ui/tests/src/Functional/Form/PurgerAddFormTest.php, line 118

Class

PurgerAddFormTest
Tests \Drupal\purge_ui\Form\PurgerAddForm.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testTwoAvailablePurgers() : void {
  $this
    ->initializePurgersService([
    'c',
    'withform',
  ]);
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->fieldExists('edit-plugin-id-a');
  $this
    ->assertSession()
    ->fieldExists('edit-plugin-id-b');
  $this
    ->assertSession()
    ->fieldExists('edit-plugin-id-good');
  $this
    ->assertSession()
    ->pageTextContains('Purger A');
  $this
    ->assertSession()
    ->pageTextContains('Purger B');
  $this
    ->assertSession()
    ->pageTextContains('Good Purger');
  $this
    ->assertSession()
    ->pageTextNotContains('Configurable purger');
  $this
    ->assertActionExists('edit-cancel', 'Cancel');
  $this
    ->assertActionExists('edit-submit', 'Add');
}