Loading core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ public function testLinkExistsExact() { public function testInvalidLinkExistsExact() { $this->drupalGet('test-pipe-char'); $this->expectException(ExpectationException::class); $this->expectExceptionMessage('Link with label foo|bar found'); $this->expectExceptionMessage('Link with label foo|bar not found'); $this->assertSession()->linkExistsExact('foo|bar'); } Loading Loading @@ -253,7 +253,7 @@ public function testResponseHeaderDoesNotExist() { public function testInvalidLinkNotExistsExact() { $this->drupalGet('test-pipe-char'); $this->expectException(ExpectationException::class); $this->expectExceptionMessage('Link with label foo|bar|baz not found'); $this->expectExceptionMessage('Link with label foo|bar|baz found'); $this->assertSession()->linkNotExistsExact('foo|bar|baz'); } Loading core/tests/Drupal/Tests/WebAssert.php +6 −6 Original line number Diff line number Diff line Loading @@ -294,7 +294,7 @@ public function titleEquals($expected_title) { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkExists($label, $index = 0, $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[$index]), $message); } Loading @@ -317,7 +317,7 @@ public function linkExists($label, $index = 0, $message = '') { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkExistsExact($label, $index = 0, $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_exact', ['link', $label]); $this->assert(!empty($links[$index]), $message); } Loading @@ -338,7 +338,7 @@ public function linkExistsExact($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 not found.', ['%label' => $label])); $message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label])); $links = $this->session->getPage()->findAll('named', ['link', $label]); $this->assert(empty($links), $message); } Loading @@ -359,7 +359,7 @@ public function linkNotExists($label, $message = '') { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkNotExistsExact($label, $message = '') { $message = ($message ? $message : strtr('Link with label %label not found.', ['%label' => $label])); $message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label])); $links = $this->session->getPage()->findAll('named_exact', ['link', $label]); $this->assert(empty($links), $message); } Loading @@ -382,7 +382,7 @@ public function linkNotExistsExact($label, $message = '') { */ public function linkByHrefExists($href, $index = 0, $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[$index]), $message); } Loading @@ -403,7 +403,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('No link containing href %href found.', ['%href' => $href])); $message = ($message ? $message : strtr('Link containing href %href found.', ['%href' => $href])); $links = $this->session->getPage()->findAll('xpath', $xpath); $this->assert(empty($links), $message); } Loading Loading
core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ public function testLinkExistsExact() { public function testInvalidLinkExistsExact() { $this->drupalGet('test-pipe-char'); $this->expectException(ExpectationException::class); $this->expectExceptionMessage('Link with label foo|bar found'); $this->expectExceptionMessage('Link with label foo|bar not found'); $this->assertSession()->linkExistsExact('foo|bar'); } Loading Loading @@ -253,7 +253,7 @@ public function testResponseHeaderDoesNotExist() { public function testInvalidLinkNotExistsExact() { $this->drupalGet('test-pipe-char'); $this->expectException(ExpectationException::class); $this->expectExceptionMessage('Link with label foo|bar|baz not found'); $this->expectExceptionMessage('Link with label foo|bar|baz found'); $this->assertSession()->linkNotExistsExact('foo|bar|baz'); } Loading
core/tests/Drupal/Tests/WebAssert.php +6 −6 Original line number Diff line number Diff line Loading @@ -294,7 +294,7 @@ public function titleEquals($expected_title) { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkExists($label, $index = 0, $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[$index]), $message); } Loading @@ -317,7 +317,7 @@ public function linkExists($label, $index = 0, $message = '') { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkExistsExact($label, $index = 0, $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_exact', ['link', $label]); $this->assert(!empty($links[$index]), $message); } Loading @@ -338,7 +338,7 @@ public function linkExistsExact($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 not found.', ['%label' => $label])); $message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label])); $links = $this->session->getPage()->findAll('named', ['link', $label]); $this->assert(empty($links), $message); } Loading @@ -359,7 +359,7 @@ public function linkNotExists($label, $message = '') { * Thrown when element doesn't exist, or the link label is a different one. */ public function linkNotExistsExact($label, $message = '') { $message = ($message ? $message : strtr('Link with label %label not found.', ['%label' => $label])); $message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label])); $links = $this->session->getPage()->findAll('named_exact', ['link', $label]); $this->assert(empty($links), $message); } Loading @@ -382,7 +382,7 @@ public function linkNotExistsExact($label, $message = '') { */ public function linkByHrefExists($href, $index = 0, $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[$index]), $message); } Loading @@ -403,7 +403,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('No link containing href %href found.', ['%href' => $href])); $message = ($message ? $message : strtr('Link containing href %href found.', ['%href' => $href])); $links = $this->session->getPage()->findAll('xpath', $xpath); $this->assert(empty($links), $message); } Loading