function LocalTasksTest::assertSameLocalTaskUrl
Asserts that the local task URL matches the expected alias.
Parameters
string $alias: The expected path alias.
1 call to LocalTasksTest::assertSameLocalTaskUrl()
- LocalTasksTest::testLocalTaskBlockUrl in core/modules/ system/ tests/ src/ Functional/ Menu/ LocalTasksTest.php 
- Tests local task block URLs for entities with path aliases.
File
- 
              core/modules/ system/ tests/ src/ Functional/ Menu/ LocalTasksTest.php, line 364 
Class
- LocalTasksTest
- Tests local tasks derived from router and added/altered via hooks.
Namespace
Drupal\Tests\system\Functional\MenuCode
protected function assertSameLocalTaskUrl(string $alias) : void {
  // Assert that the href attribute of the 'View' link contains the expected
  // alias.
  $link = $this->assertSession()
    ->elementExists('xpath', '//a[text()="View"]');
  $this->assertStringContainsString($alias, $link->getAttribute('href'));
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
