You are here

protected function AjaxFormTestBase::assertActionNotExists in Purge 8.3

Assert that the given action does not exist.

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.

2 calls to AjaxFormTestBase::assertActionNotExists()
PluginConfigFormTestBase::testCancelPresenceOrAbsence in modules/purge_ui/tests/src/Functional/Form/Config/PluginConfigFormTestBase.php
Tests cancel button presence/absence.
QueueBrowserFormTest::testData in modules/purge_ui/tests/src/Functional/Form/QueueBrowserFormTest.php
Tests that data is shown accordingly.

File

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

Class

AjaxFormTestBase
Testbase for Ajax-based purge_ui forms.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

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