function ModuleGrantsBasicTestCase::testModuleImplementsHook in Module Grants 7
File
- ./
module_grants.test, line 554
Class
Code
function testModuleImplementsHook() {
$hook = 'node_access';
$modules = module_implements($hook);
$this
->assertEqual(1, count($modules), "Only one module implements hook_node_access()");
$this
->assertTrue(array_shift($modules) === 'module_grants', "The module implements hook_node_access() is module_grants");
$module_implements = module_grants_set_node_access_implementations();
$this
->assertEqual(2, count($module_implements), "2 module's hook_node_access() is saved by module grants");
$this
->assertTrue(isset($module_implements['node']), "Node module's hook_node_access() is saved by module grants");
$this
->assertTrue(isset($module_implements['module_grants_test_access_hook']), "module_grants_test_access_hook module's hook_node_access() is saved by module grants");
}