You are here

protected function WebformAssertLegacyTrait::assertLink in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Traits/WebformAssertLegacyTrait.php \Drupal\Tests\webform\Traits\WebformAssertLegacyTrait::assertLink()

Passes if a link with the specified label is found.

An optional link index may be passed.

Parameters

string|\Drupal\Component\Render\MarkupInterface $label: Text between the anchor tags.

int $index: Link position counting from zero.

11 calls to WebformAssertLegacyTrait::assertLink()
WebformAccessTest::testWebformAccess in modules/webform_access/tests/src/Functional/WebformAccessTest.php
Tests webform access.
WebformAccessTest::testWebformAdministratorAccess in modules/webform_access/tests/src/Functional/WebformAccessTest.php
Tests webform administrator access.
WebformCompositeCustomFileTest::testCustom in tests/src/Functional/Composite/WebformCompositeCustomFileTest.php
Test custom composite element.
WebformElementCaptchaTest::testCaptcha in tests/src/Functional/Element/WebformElementCaptchaTest.php
Test CAPTCHA element.
WebformEntityPrintFunctionalTest::testEntityPrint in modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php
Test entity print.

... See full list

File

tests/src/Traits/WebformAssertLegacyTrait.php, line 351

Class

WebformAssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\Tests\webform\Traits

Code

protected function assertLink($label, $index = 0) {
  return $this
    ->assertSession()
    ->linkExists($label, $index);
}