function SearchIntegrationTest::assertOneLink
Asserts that exactly one link exists with the given text.
@internal
Parameters
string $label: Link label to assert.
1 call to SearchIntegrationTest::assertOneLink()
- SearchIntegrationTest::testSearchIntegration in core/modules/ views/ tests/ src/ Functional/ SearchIntegrationTest.php 
- Tests search integration.
File
- 
              core/modules/ views/ tests/ src/ Functional/ SearchIntegrationTest.php, line 149 
Class
- SearchIntegrationTest
- Tests search integration filters.
Namespace
Drupal\Tests\views\FunctionalCode
protected function assertOneLink(string $label) : void {
  $xpath = $this->assertSession()
    ->buildXPathQuery('//a[normalize-space(text())=:label]', [
    ':label' => $label,
  ]);
  $this->assertSession()
    ->elementsCount('xpath', $xpath, 1);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
