You are here

protected function WebformAssertLegacyTrait::assertFieldByName in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Traits/WebformAssertLegacyTrait.php \Drupal\Tests\webform\Traits\WebformAssertLegacyTrait::assertFieldByName()

Asserts that a field exists with the given name and value.

Parameters

string $name: Name of field to assert.

string $value: (optional) Value of the field to assert. You may pass in NULL (default) to skip checking the actual value, while still checking that the field exists.

50 calls to WebformAssertLegacyTrait::assertFieldByName()
WebformAccessEntityJsonApiTest::testRestAccess in tests/src/Functional/Access/WebformAccessEntityJsonApiTest.php
Tests webform entity REST acces.
WebformAccessEntityRestTest::testRestAccess in tests/src/Functional/Access/WebformAccessEntityRestTest.php
Tests webform entity REST acces.
WebformAccessTest::testWebformAccess in modules/webform_access/tests/src/Functional/WebformAccessTest.php
Tests webform access.
WebformAccessTest::testWebformAdministratorAccess in modules/webform_access/tests/src/Functional/WebformAccessTest.php
Tests webform administrator access.
WebformBlockTest::testBlock in tests/src/Functional/Block/WebformBlockTest.php
Tests webform block.

... See full list

File

tests/src/Traits/WebformAssertLegacyTrait.php, line 243

Class

WebformAssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\Tests\webform\Traits

Code

protected function assertFieldByName($name, $value = NULL) {
  $this
    ->assertFieldByXPath($this
    ->constructFieldXpath('name', $name), $value);
}