protected function EntityMetadataNodeAccessTestCase::assertNodeMetadataAccess in Entity API 7
Asserts node_access() correctly grants or denies access.
1 call to EntityMetadataNodeAccessTestCase::assertNodeMetadataAccess()
- EntityMetadataNodeAccessTestCase::testNodeMetadataAccess in ./
entity.test - Runs basic tests for entity_access() function.
File
- ./
entity.test, line 1144 - Entity CRUD API tests.
Class
- EntityMetadataNodeAccessTestCase
- Tests basic entity_access() functionality for nodes.
Code
protected function assertNodeMetadataAccess($ops, $node, $account) {
foreach ($ops as $op => $result) {
$msg = t("entity_access() returns @result with operation '@op'.", array(
'@result' => $result ? 'TRUE' : 'FALSE',
'@op' => $op,
));
$access = entity_access($op, 'node', $node, $account);
$this
->assertEqual($result, $access, $msg);
}
}