You are here

public function NodeaccesssRoleTestCase::setUp in Nodeaccess 7

Enable the nodeaccess module. Add type grant for pages. Rebuild perms.

Overrides DrupalWebTestCase::setUp

File

tests/nodeaccess_role.test, line 20
Tests for the nodeaccess module.

Class

NodeaccesssRoleTestCase
Tests the functionality of the nodeaccess module.

Code

public function setUp() {
  parent::setUp('nodeaccess');
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access content',
  ));
  nodeaccess_add_type_grant('page');

  // Create a page node, authored by admin.
  $this->node = $this
    ->drupalCreateNode(array(
    'type' => 'page',
    'uid' => 1,
  ));

  // Let's create a sample authenticated user with basic permissions.
  $this->user = $this
    ->drupalCreateUser(array(
    'access content',
  ));
  node_access_rebuild();
}