protected function SearchIntegrationTest::assertOneLink in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Functional/SearchIntegrationTest.php \Drupal\Tests\views\Functional\SearchIntegrationTest::assertOneLink()
- 9 core/modules/views/tests/src/Functional/SearchIntegrationTest.php \Drupal\Tests\views\Functional\SearchIntegrationTest::assertOneLink()
Asserts that exactly one link exists with the given text.
@internal
Parameters
string $label: Link label to assert.
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);
}