private function MenuTestCase::verifyAccess

7.x 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.:

1 call to MenuTestCase::verifyAccess()
MenuTestCase::testMenu in drupal-7.x/modules/menu/menu.test
Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.

File

drupal-7.x/modules/menu/menu.test, line 535
Tests for menu.module.

Class

MenuTestCase

Code

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

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

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

  // View menu edit node.
  $item = $this->getStandardMenuLink();
  $this->drupalGet('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->drupalGet('admin/structure/menu/settings');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Menus'), 'Menu settings node was displayed');
  }

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