You are here

function ContentAccessTestCase::changeAccessNodeKeyword in Content Access 5

Same name and namespace in other branches
  1. 6 tests/content_access_test_help.php \ContentAccessTestCase::changeAccessNodeKeyword()
  2. 7 tests/content_access_test_help.php \ContentAccessTestCase::changeAccessNodeKeyword()

Change access permissions for a node by a given keyword (view, update or delete)

3 calls to ContentAccessTestCase::changeAccessNodeKeyword()
ContentAccessModuleTestCase::testDeleteAccess in tests/content_access.test
Test for deleting nodes
ContentAccessModuleTestCase::testEditAccess in tests/content_access.test
Test for editing nodes
ContentAccessModuleTestCase::testViewAccess in tests/content_access.test
Test for viewing nodes

File

tests/content_access_test_help.php, line 102
Helper class with auxiliary functions for content access module tests

Class

ContentAccessTestCase
@file Helper class with auxiliary functions for content access module tests

Code

function changeAccessNodeKeyword($node, $keyword, $access = TRUE) {
  $user = $this->test_user;
  $roles = $user->roles;
  end($roles);
  $access_settings = array(
    $keyword . '[' . key($roles) . ']' => $access,
  );
  $this
    ->changeAccessNode($node, $access_settings);
}