protected function LocalTasksTest::assertLocalTaskAppears in Drupal 8
Same name and namespace in other branches
- 9 core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php \Drupal\Tests\system\Functional\Menu\LocalTasksTest::assertLocalTaskAppears()
- 10 core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php \Drupal\Tests\system\Functional\Menu\LocalTasksTest::assertLocalTaskAppears()
Ensures that some local task appears.
Parameters
string $title: The expected title.
Return value
bool TRUE if the local task exists on the page.
1 call to LocalTasksTest::assertLocalTaskAppears()
- LocalTasksTest::testPluginLocalTask in core/
modules/ system/ tests/ src/ Functional/ Menu/ LocalTasksTest.php - Tests the plugin based local tasks.
File
- core/
modules/ system/ tests/ src/ Functional/ Menu/ LocalTasksTest.php, line 76
Class
- LocalTasksTest
- Tests local tasks derived from router and added/altered via hooks.
Namespace
Drupal\Tests\system\Functional\MenuCode
protected function assertLocalTaskAppears($title) {
// SimpleXML gives us the unescaped text, not the actual escaped markup,
// so use a pattern instead to check the raw content.
// This behavior is a bug in libxml, see
// https://bugs.php.net/bug.php?id=49437.
return $this
->assertPattern('@<a [^>]*>' . preg_quote($title, '@') . '</a>@');
}