public function MenuTranslateTest::testMenuTranslate

Tests _menu_translate().

File

drupal/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTranslateTest.php, line 37
Contains \Drupal\system\Tests\Menu\MenuTranslateTest.

Class

MenuTranslateTest
Defines a test class which tests the _menu_translate method.

Namespace

Drupal\system\Tests\Menu

Code

public function testMenuTranslate() {

  // Check for access to a restricted local task from a default local task.
  $this
    ->drupalGet('foo/asdf');
  $this
    ->assertResponse(200);
  $this
    ->assertLinkByHref('foo/asdf');
  $this
    ->assertLinkByHref('foo/asdf/b');
  $this
    ->assertNoLinkByHref('foo/asdf/c');

  // Attempt to access a restricted local task.
  $this
    ->drupalGet('foo/asdf/c');
  $this
    ->assertResponse(403);
  $this
    ->assertNoLinkByHref('foo/asdf');
  $this
    ->assertNoLinkByHref('foo/asdf/b');
  $this
    ->assertNoLinkByHref('foo/asdf/c');
}