function NodeAccessTestCase::assertNodeAccess

7.x node.test NodeAccessTestCase::assertNodeAccess($ops, $node, $account)

Asserts node_access() correctly grants or denies access.

1 call to NodeAccessTestCase::assertNodeAccess()
NodeAccessTestCase::testNodeAccess in drupal-7.x/modules/node/node.test
Runs basic tests for node_access function.

File

drupal-7.x/modules/node/node.test, line 934
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);
  }
}