You are here

public function MenuTestCase::testMenuParentsJsAccess in Drupal 7

Test administrative users other than user 1 can access the menu parents AJAX callback.

File

modules/menu/menu.test, line 560
Tests for menu.module.

Class

MenuTestCase
@file Tests for menu.module.

Code

public function testMenuParentsJsAccess() {
  $admin = $this
    ->drupalCreateUser(array(
    'administer menu',
  ));
  $this
    ->drupalLogin($admin);

  // Just check access to the callback overall, the POST data is irrelevant.
  $this
    ->drupalGetAJAX('admin/structure/menu/parents');
  $this
    ->assertResponse(200);

  // Do standard user tests.
  // Login the user.
  $this
    ->drupalLogin($this->std_user);
  $this
    ->drupalGetAJAX('admin/structure/menu/parents');
  $this
    ->assertResponse(403);
}