function NodeAccessTestCase::assertNodeAccess in Drupal 7
Asserts node_access() correctly grants or denies access.
1 call to NodeAccessTestCase::assertNodeAccess()
- NodeAccessTestCase::testNodeAccess in modules/
node/ node.test - Runs basic tests for node_access function.
File
- modules/
node/ node.test, line 1006 - Tests for node.module.
Class
- NodeAccessTestCase
- Tests basic node_access functionality.
Code
function assertNodeAccess($ops, $node, $account) {
foreach ($ops as $op => $result) {
$msg = format_string("node_access returns @result with operation '@op'.", array(
'@result' => $result ? 'true' : 'false',
'@op' => $op,
));
$this
->assertEqual($result, node_access($op, $node, $account), $msg);
}
}