You are here

protected function LocalTasksTest::assertNoLocalTasks 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::assertNoLocalTasks()

Asserts that the local tasks on the specified level are not being printed.

Parameters

int $level: (optional) The local tasks level to assert; 0 for primary, 1 for secondary. Defaults to 0.

1 call to LocalTasksTest::assertNoLocalTasks()
LocalTasksTest::testLocalTaskBlock in core/modules/system/src/Tests/Menu/LocalTasksTest.php
Tests that local task blocks are configurable to show a specific level.

File

core/modules/system/src/Tests/Menu/LocalTasksTest.php, line 96
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 assertNoLocalTasks($level = 0) {
  $elements = $this
    ->xpath('//*[contains(@class, :class)]//a', array(
    ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary',
  ));
  $this
    ->assertFalse(count($elements), 'Local tasks not found.');
}