Loading core/lib/Drupal/Core/Test/AssertMailTrait.php +12 −9 Original line number Diff line number Diff line Loading @@ -47,9 +47,10 @@ protected function getMails(array $filter = []) { * Value of the field to assert. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @return bool * TRUE on pass. Loading @@ -74,9 +75,10 @@ protected function assertMail($name, $value = '', $message = '') { * Number of emails to search for string, starting with most recent. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. */ protected function assertMailString($field_name, $string, $email_depth, $message = '') { $mails = $this->getMails(); Loading Loading @@ -109,9 +111,10 @@ protected function assertMailString($field_name, $string, $email_depth, $message * Pattern to search for. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. */ protected function assertMailPattern($field_name, $regex, $message = '') { $mails = $this->getMails(); Loading core/tests/Drupal/KernelTests/AssertContentTrait.php +148 −111 File changed.Preview size limit exceeded, changes collapsed. Show changes core/tests/Drupal/Tests/WebAssert.php +16 −12 Original line number Diff line number Diff line Loading @@ -387,9 +387,10 @@ public function linkNotExistsExact($label, $message = '') { * Link position counting from zero. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -410,9 +411,10 @@ public function linkByHrefExists($href, $index = 0, $message = '') { * Link position counting from zero. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -431,9 +433,10 @@ public function linkByHrefExistsExact(string $href, int $index = 0, string $mess * The full or partial value of the 'href' attribute of the anchor tag. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -452,9 +455,10 @@ public function linkByHrefNotExists($href, $message = '') { * The full value of the 'href' attribute of the anchor tag. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading Loading
core/lib/Drupal/Core/Test/AssertMailTrait.php +12 −9 Original line number Diff line number Diff line Loading @@ -47,9 +47,10 @@ protected function getMails(array $filter = []) { * Value of the field to assert. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @return bool * TRUE on pass. Loading @@ -74,9 +75,10 @@ protected function assertMail($name, $value = '', $message = '') { * Number of emails to search for string, starting with most recent. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. */ protected function assertMailString($field_name, $string, $email_depth, $message = '') { $mails = $this->getMails(); Loading Loading @@ -109,9 +111,10 @@ protected function assertMailString($field_name, $string, $email_depth, $message * Pattern to search for. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. */ protected function assertMailPattern($field_name, $regex, $message = '') { $mails = $this->getMails(); Loading
core/tests/Drupal/KernelTests/AssertContentTrait.php +148 −111 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/tests/Drupal/Tests/WebAssert.php +16 −12 Original line number Diff line number Diff line Loading @@ -387,9 +387,10 @@ public function linkNotExistsExact($label, $message = '') { * Link position counting from zero. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -410,9 +411,10 @@ public function linkByHrefExists($href, $index = 0, $message = '') { * Link position counting from zero. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -431,9 +433,10 @@ public function linkByHrefExistsExact(string $href, int $index = 0, string $mess * The full or partial value of the 'href' attribute of the anchor tag. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading @@ -452,9 +455,10 @@ public function linkByHrefNotExists($href, $message = '') { * The full value of the 'href' attribute of the anchor tag. * @param string $message * (optional) A message to display with the assertion. Do not translate * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * messages with t(). Use double quotes and embed variables directly in * message text, or use sprintf() if necessary. Avoid the use of * \Drupal\Component\Render\FormattableMarkup unless you cast the object to * a string. If left blank, a default message will be displayed. * * @throws \Behat\Mink\Exception\ExpectationException * Thrown when element doesn't exist, or the link label is a different one. Loading