You are here

public function NodeaccesssRoleTestCase::testRoleNodeVisibilityViewAuthenticatedOnly in Nodeaccess 7

Test node access when only Authenticated users should have view access.

File

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

Class

NodeaccesssRoleTestCase
Tests the functionality of the nodeaccess module.

Code

public function testRoleNodeVisibilityViewAuthenticatedOnly() {
  $grants = array(
    array(
      'gid' => DRUPAL_ANONYMOUS_RID,
      'realm' => 'nodeaccess_rid',
      'grant_view' => 0,
      'grant_update' => 0,
      'grant_delete' => 0,
    ),
    array(
      'gid' => DRUPAL_AUTHENTICATED_RID,
      'realm' => 'nodeaccess_rid',
      'grant_view' => 1,
      'grant_update' => 0,
      'grant_delete' => 0,
    ),
  );
  nodeaccess_set_grants($this->node, $grants);

  // Run all tests from grant.
  $this
    ->checkRoleGrantAccesses($grants);
}