function ModuleGrantsBasicTestCase::testNoModuleGrants in Module Grants 7
File
- ./
module_grants.test, line 565
Class
Code
function testNoModuleGrants() {
$account = $this
->drupalCreateUser(array(
'access content',
));
$this
->assertFalse(node_access('create', 'article', $account), t("User with only 'access content' permisson cannot create article"));
$node = $this
->drupalCreateNode(array(
'title' => "Test node dog blue three",
'type' => 'article',
));
foreach (array(
'view',
'update',
'delete',
) as $op) {
$account = $this
->drupalCreateUser(array(
'access content',
));
$this
->assertFalse(node_access($op, $node, $account), t("User with only 'access content' permission cannot {$op} article node @title", array(
'@title' => $node->title,
)));
}
}