You are here

protected function WebTestBase::clickLinkPartialName in SimpleTest 8.3

Follows a link by partial name.

If the link is discovered and clicked, the test passes. Fail otherwise.

Parameters

string|\Drupal\Component\Render\MarkupInterface $label: Text between the anchor tags, uses starts-with().

int $index: Link position counting from zero.

Return value

string|bool Page contents on success, or FALSE on failure.

See also

::clickLink()

File

src/WebTestBase.php, line 1714

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function clickLinkPartialName($label, $index = 0) {
  return $this
    ->clickLinkHelper($label, $index, '//a[starts-with(normalize-space(), :label)]');
}