function DrupalUnitTests::drupalModuleDisable in SimpleTest 5
Same name and namespace in other branches
- 6 drupal_unit_tests.php \DrupalUnitTests::drupalModuleDisable()
Disables a drupal module
Parameters
string $name name of the module:
Return value
boolean success
File
- ./
drupal_unit_tests.php, line 156
Class
Code
function drupalModuleDisable($name) {
if (!module_exists($name)) {
return TRUE;
}
/* Update table */
db_query("UPDATE {system} SET status = 0 WHERE name = '%s' AND type = 'module'", $name);
if (db_affected_rows()) {
/* Make sure not overwriting when double switching */
if (!isset($this->_cleanupModules[$name])) {
$this->_cleanupModules[$name] = 1;
}
/* refresh module_list */
module_list(TRUE, FALSE);
return TRUE;
}
die("incompatible module {$name} could not be disabled for unknown reason");
}