You are here

protected function LocalTasksTest::assertLocalTaskAppers in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Menu/LocalTasksTest.php \Drupal\system\Tests\Menu\LocalTasksTest::assertLocalTaskAppers()

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::assertLocalTaskAppers()
LocalTasksTest::testPluginLocalTask in core/modules/system/src/Tests/Menu/LocalTasksTest.php
Tests the plugin based local tasks.

File

core/modules/system/src/Tests/Menu/LocalTasksTest.php, line 81
Contains \Drupal\system\Tests\Menu\LocalTasksTest.

Class

LocalTasksTest
Tests local tasks derived from router and added/altered via hooks.

Namespace

Drupal\system\Tests\Menu

Code

protected function assertLocalTaskAppers($title) {

  // SimpleXML gives us the unescaped text, not the actual escaped markup,
  // so use a pattern instead to check the raw content.
  // This behaviour is a bug in libxml, see
  // https://bugs.php.net/bug.php?id=49437.
  return $this
    ->assertPattern('@<a [^>]*>' . preg_quote($title, '@') . '</a>@');
}