1 menu.test private MenuTestCase::verifyAccess($response = 200)

Verify the logged in user has the desired access to the various menu nodes.

Parameters

integer $response HTTP response code.:

File

core/modules/menu/tests/menu.test, line 610
Tests for menu.module.

Class

MenuTestCase

Code

private function verifyAccess($response = 200) {
  // View menu help node.
  $this->backdropGet('admin/help/menu');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Menu'), 'Menu help was displayed');
  }

  // View menu build overview node.
  $this->backdropGet('admin/structure/menu');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Menus'), 'Menu build overview node was displayed');
  }

  // View main-menu menu customization node.
  $this->backdropGet('admin/structure/menu/manage/main-menu');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Primary navigation'), 'Primary navigation menu node was displayed');
  }

  // View menu edit node.
  $item = $this->getStandardMenuLink();
  $this->backdropGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Edit menu item'), 'Menu edit node was displayed');
  }

  // View menu settings node.
  $this->backdropGet('admin/structure/menu/settings');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Menus'), 'Menu settings node was displayed');
  }

  // View add menu node.
  $this->backdropGet('admin/structure/menu/add');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Menus'), 'Add menu node was displayed');
  }
}