You are here

public function BambooTwigTestBase::assertLinkUrlExist in Bamboo Twig 8

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertLinkUrlExist()
  2. 8.2 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertLinkUrlExist()
  3. 8.3 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertLinkUrlExist()
  4. 8.4 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertLinkUrlExist()

Passes if a link containing a given href (part) is found.

Parameters

string $href: The full or partial value of the 'href' attribute of the anchor tag.

int $index: (optional) Link position counting from zero.

Throws

\Behat\Mink\Exception\ExpectationException Thrown when element doesn't exist, or the link label is a different one.

See also

\Behat\Mink\WebAssert::linkByHrefExists

1 call to BambooTwigTestBase::assertLinkUrlExist()
BambooTwigLoaderTest::testEntity in tests/src/Functional/BambooTwigLoadersTest.php
@covers Drupal\bamboo_twig_loaders\TwigExtension\Loader::loadEntity

File

tests/src/Functional/BambooTwigTestBase.php, line 111

Class

BambooTwigTestBase
Has some additional helper methods to make test code more readable.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function assertLinkUrlExist($href, $index = 0) {
  $this
    ->assertSession()
    ->linkByHrefExists($href, $index = 0);
}