diff --git a/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php b/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php index 4448454..e1c08bb 100644 --- a/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php +++ b/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php @@ -68,7 +68,8 @@ public function testForm() { $this->assertSession()->hiddenFieldValueNotEquals('strawberry', 'brown'); $this->assertSession()->hiddenFieldValueEquals('strawberry', 'red'); - // Check that a hidden filed does not exist. + // Check that a hidden field does not exist. + $this->assertSession()->hiddenFieldNotExists('bananas'); $this->assertSession()->hiddenFieldNotExists('pineapple'); $edit = ['bananas' => 'green']; diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php index b1fb35d..9eb9842 100644 --- a/core/tests/Drupal/Tests/WebAssert.php +++ b/core/tests/Drupal/Tests/WebAssert.php @@ -476,7 +476,7 @@ public function hiddenFieldValueEquals($field, $value, TraversableElement $conta $node = $this->hiddenFieldExists($field, $container); $actual = $node->getValue(); $regex = '/^'.preg_quote($value, '/').'$/ui'; - $message = sprintf('The hidden field "%s" value is "%s", but "%s" expected.', $field, $actual, $value); + $message = "The hidden field '$field' value is '$actual', but '$value' expected."; $this->assert((bool) preg_match($regex, $actual), $message); } @@ -497,7 +497,7 @@ public function hiddenFieldValueNotEquals($field, $value, TraversableElement $co $node = $this->hiddenFieldExists($field, $container); $actual = $node->getValue(); $regex = '/^'.preg_quote($value, '/').'$/ui'; - $message = sprintf('The hidden field "%s" value is "%s", but it should not be.', $field, $actual); + $message = "The hidden field '$field' value is '$actual', but it should not be."; $this->assert(!preg_match($regex, $actual), $message); }