diff -u b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php --- b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -170,6 +170,7 @@ $this->assertNoFieldByName('notexisting'); $this->assertNoFieldByName('notexisting', NULL); + // Test that the assertion fails correctly if no value is passed in. try { $this->assertNoFieldByName('description'); $this->fail('The "description" field, with no value was not found.'); @@ -177,6 +178,15 @@ catch (ExpectationException $e) { $this->pass('The "description" field, with no value was found.'); } + + // Test that the assertion fails correctly if a NULL value is passed in. + try { + $this->assertNoFieldByName('name', NULL); + $this->fail('The "name" field was not found.'); + } + catch (ExpectationException $e) { + $this->pass('The "name" field was found.'); + } } /**