diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 3a07501..a829184 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -138,6 +138,58 @@ public function testPipeCharInLocator() { } /** + * Tests linkExistsExact() functionality. + * + * @see \Drupal\Tests\WebAssert::linkExistsExact() + */ + public function testLinkExistsExact() { + $this->drupalGet('test-pipe-char'); + $this->assertSession()->linkExistsExact('foo|bar|baz'); + } + + /** + * Tests linkExistsExact() functionality fail. + * + * @see \Drupal\Tests\WebAssert::linkExistsExact() + */ + public function testLinkNonExistsExact() { + $this->drupalGet('test-pipe-char'); + try { + $this->assertSession()->linkExistsExact('foo|bar'); + $this->fail('The exactly "foor|bar" label link was found.'); + } + catch (ExpectationException $e) { + $this->pass('testLinkNonExistsExact correctly failed. The exactly "foor|bar" label link was not found.'); + } + } + + /** + * Tests linkNotExistsExact() functionality. + * + * @see \Drupal\Tests\WebAssert::linkNotExistsExact() + */ + public function testNotLinkExistsExact() { + $this->drupalGet('test-pipe-char'); + $this->assertSession()->linkNotExistsExact('foo|bar'); + } + + /** + * Tests linkNotExistsExact() functionality fail. + * + * @see \Drupal\Tests\WebAssert::linkNotExistsExact() + */ + public function testNotLinkNonExistsExact() { + $this->drupalGet('test-pipe-char'); + try { + $this->assertSession()->linkNotExistsExact('foo|bar|baz'); + $this->fail('The exactly "foo|bar|baz" label link was not found.'); + } + catch (ExpectationException $e) { + $this->pass('testNotLinkNonExistsExact correctly failed. The exactly "foo|bar|baz" label link was found.'); + } + } + + /** * Tests legacy text asserts. */ public function testLegacyTextAsserts() {