You are here

public function AckMenuAccessTest::setUpScheme in Access Control Kit 7

Utility function to set up the access scheme.

2 calls to AckMenuAccessTest::setUpScheme()
AckMenuAccessTest::setUpMenu in ack_menu/ack_menu.test
Utility function to set up a menu link access test.
AckMenuAccessTest::testEventHooks in ack_menu/ack_menu.test
Test that the module responds appropriately to events that affect the map.

File

ack_menu/ack_menu.test, line 127
Tests for the ACK menu module.

Class

AckMenuAccessTest
Tests the menu access functions.

Code

public function setUpScheme() {

  // Create a simple user-based scheme.
  $this->schemeMachineName = drupal_strtolower($this
    ->randomName());
  $name = $this
    ->randomName();
  $edit = array(
    'name' => $name,
    'machine_name' => $this->schemeMachineName,
    'roles[' . $this->ackRole->rid . ']' => TRUE,
  );
  $this
    ->drupalPost('admin/structure/access/add/user', $edit, 'Save access scheme and continue');

  // Attach the menu map handler.
  $edit = array(
    'handlers[menu_link][handler]' => 'AckMenuMap',
    'handlers[menu_link][AckMenuMap][menus][navigation]' => TRUE,
  );
  $this
    ->drupalPost(NULL, $edit, 'Save access scheme');
  $this
    ->assertText(t('Updated access scheme @name', array(
    '@name' => $name,
  )), 'Access scheme configured.');
}