function ShortcutLinksTest::assertShortcutQuickLink
Passes if a shortcut quick link with the specified label is found.
An optional link index may be passed.
@internal
Parameters
string $label: Text between the anchor tags.
int $index: Link position counting from zero.
string $message: (optional) A message to display with the assertion. Do not translate messages: use new FormattableMarkup() to embed variables in the message text, not t(). If left blank, a default message will be displayed.
1 call to ShortcutLinksTest::assertShortcutQuickLink()
- ShortcutLinksTest::testShortcutQuickLink in core/modules/ shortcut/ tests/ src/ Functional/ ShortcutLinksTest.php 
- Tests that the "add to shortcut" and "remove from shortcut" links work.
File
- 
              core/modules/ shortcut/ tests/ src/ Functional/ ShortcutLinksTest.php, line 488 
Class
- ShortcutLinksTest
- Create, view, edit, delete, and change shortcut links.
Namespace
Drupal\Tests\shortcut\FunctionalCode
protected function assertShortcutQuickLink(string $label, int $index = 0, string $message = '') : void {
  $links = $this->xpath('//a[normalize-space()=:label]', [
    ':label' => $label,
  ]);
  $message = $message ?: "Shortcut quick link with label {$label} found.";
  $this->assertArrayHasKey($index, $links, $message);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
