You are here

protected function AjaxFormTestBase::assertActionExists in Purge 8.3

Assert that the given action exists.

For some unknown reason, WebAssert::fieldExists() doesn't work on Ajax modal forms, is doesn't detect form fields while they do exist in the raw HTML response. This temporary assertion aids aims to solve this.

Parameters

string $id: The id of the action field.

string $value: The expected value of the action field.

8 calls to AjaxFormTestBase::assertActionExists()
PluginConfigFormTestBase::testCancelPresenceOrAbsence in modules/purge_ui/tests/src/Functional/Form/Config/PluginConfigFormTestBase.php
Tests cancel button presence/absence.
PluginConfigFormTestBase::testSaveConfigurationPresence in modules/purge_ui/tests/src/Functional/Form/Config/PluginConfigFormTestBase.php
Tests save button presence/absence.
ProcessorAddFormTest::testCancelPresence in modules/purge_ui/tests/src/Functional/Form/ProcessorAddFormTest.php
Tests that the cancel button is present.
PurgerAddFormTest::testCancelPresence in modules/purge_ui/tests/src/Functional/Form/PurgerAddFormTest.php
Tests that the cancel button is present.
PurgerAddFormTest::testTwoAvailablePurgers in modules/purge_ui/tests/src/Functional/Form/PurgerAddFormTest.php
Tests the 'plugin_id' form element for listing only available purgers.

... See full list

File

modules/purge_ui/tests/src/Functional/Form/AjaxFormTestBase.php, line 120

Class

AjaxFormTestBase
Testbase for Ajax-based purge_ui forms.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

protected function assertActionExists($id, $value) : void {
  $this
    ->assertSession()
    ->responseContains(sprintf('type="submit" id="%s"', $id));
  $this
    ->assertSession()
    ->responseContains(sprintf('value="%s"', $value));
}