function ModuleUninstallTestCase::testUserPermsUninstalled in SimpleTest 7
Tests the hook_modules_uninstalled() of the user module.
File
- tests/
module.test, line 122 - Tests for the module API.
Class
- ModuleUninstallTestCase
- Unit tests for module uninstallation and related hooks.
Code
function testUserPermsUninstalled() {
// Uninstalls the module_test module, so hook_modules_uninstalled()
// is executed.
drupal_uninstall_modules(array(
'module_test',
));
// Are the perms defined by module_test removed from {role_permission}.
$count = db_query("SELECT COUNT(rid) FROM {role_permission} WHERE permission = :perm", array(
':perm' => 'module_test perm',
))
->fetchField();
$this
->assertEqual(0, $count, t('Permissions were all removed.'));
}