You are here

protected function AssertLegacyTrait::assertNoFieldByName in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertNoFieldByName()

Asserts that a field does not exist with the given name and value.

Parameters

string $name: Name of field to assert.

string $value: (optional) Value for the field, to assert that the field's value on the page does not match it. You may pass in NULL to skip checking the value, while still checking that the field does not exist. However, the default value ('') asserts that the field value is not an empty string.

Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead.

34 calls to AssertLegacyTrait::assertNoFieldByName()
BooleanFieldTest::testFormAccess in core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
Test field access.
BrowserTestBaseTest::testFieldAssertsForButton in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy field asserts for button field type.
BrowserTestBaseTest::testFieldAssertsForCheckbox in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy field asserts for checkbox field type.
BrowserTestBaseTest::testFieldAssertsForTextfields in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy field asserts using textfields.
CommentNonNodeTest::postComment in core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
Posts a comment.

... See full list

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 249

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertNoFieldByName($name, $value = '') {
  $this
    ->assertNoFieldByXPath($this
    ->constructFieldXpath('name', $name), $value);
}