Skip to content
Snippets Groups Projects
Commit fafa49b9 authored by catch's avatar catch
Browse files

Issue #2854249 by GoZ, himanshu-dixit, boaloysius, xjm: Default message for...

Issue #2854249 by GoZ, himanshu-dixit, boaloysius, xjm: Default message for linkNotExists and linkByHrefNotExists is wrong
parent e09ba74f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -247,7 +247,7 @@ public function linkExists($label, $index = 0, $message = '') {
* Thrown when element doesn't exist, or the link label is a different one.
*/
public function linkNotExists($label, $message = '') {
$message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label]));
$message = ($message ? $message : strtr('Link with label %label not found.', ['%label' => $label]));
$links = $this->session->getPage()->findAll('named', ['link', $label]);
$this->assert(empty($links), $message);
}
......@@ -291,7 +291,7 @@ public function linkByHrefExists($href, $index = 0, $message = '') {
*/
public function linkByHrefNotExists($href, $message = '') {
$xpath = $this->buildXPathQuery('//a[contains(@href, :href)]', [':href' => $href]);
$message = ($message ? $message : strtr('Link containing href %href found.', ['%href' => $href]));
$message = ($message ? $message : strtr('No link containing href %href found.', ['%href' => $href]));
$links = $this->session->getPage()->findAll('xpath', $xpath);
$this->assert(empty($links), $message);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment