diff -u b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php --- b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php +++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php @@ -228,14 +228,14 @@ } /** - * Asserts that a field exists with the given name and value. + * Asserts that a field don't exist with the given name and value. * * @param string $name * Name of field to assert. * @param string $value - * (optional) Value of the field to assert. You may pass in NULL (default) + * (optional) Assert field not equal to the Value. You may pass in NULL (default) * to skip checking the actual value, while still checking that the field - * exists. + * don't exist. * * @deprecated Scheduled for removal in Drupal 9.0.0. * Use $this->assertSession()->fieldNotExists() or @@ -243,7 +243,7 @@ */ protected function assertNoFieldByName($name, $value = '') { $this->assertSession()->fieldNotExists($name); - if ($value !== NULL) { + if ($value !== '') { $this->assertSession()->fieldValueNotEquals($name, (string) $value); } }