function WebTestBase::clickLinkPartialName

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

core/modules/simpletest/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)]');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.