diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index 53afc1a..7220146 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -255,7 +255,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F // Check outline structure. if ($nodes !== NULL) { - $this->assertPattern($this->generateOutlinePattern($nodes)); + $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', array('@number' => $number))); } else { $this->pass(format_string('Node %number does not have outline.', array('%number' => $number))); diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php index ad42806..b18026a 100644 --- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php +++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php @@ -208,11 +208,16 @@ protected function assertNoRaw($raw) { * * @param string $pattern * Perl regex to look for including the regex delimiters. + * @param string $message + * (optional) A message to display with the assertion. Do not translate + * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed + * variables in the message text, not t(). If left blank, a default message + * will be displayed. * * @deprecated Scheduled for removal in Drupal 9.0.0. * Use $this->assertSession()->responseMatches() instead. */ - protected function assertPattern($pattern) { + protected function assertPattern($pattern, $message = '') { $this->assertSession()->responseMatches($pattern); }