You are here

public function AccessAPITest::setUp in Access Control Kit 7

Overrides DrupalWebTestCase::setUp().

Overrides DrupalWebTestCase::setUp

File

./access.test, line 1303
Tests for the access control kit module.

Class

AccessAPITest
Tests the access control kit API.

Code

public function setUp() {

  // Enable the access control kit module and our dummy test module.
  parent::setUp(array(
    'access',
    'access_test',
  ));

  // Create a role that uses the permission defined in access_test.module.
  $rid = $this
    ->drupalCreateRole(array(
    'meow',
  ));
  $this->ackRole = user_role_load($rid);

  // Create an access scheme that uses the test role.
  $scheme = $this
    ->createScheme();
  $scheme->roles = array(
    $this->ackRole->rid => $this->ackRole->name,
  );
  variable_set('access_scheme_roles_' . $scheme->machine_name, $scheme->roles);
  $this->scheme = $scheme;
}