Created
July 19, 2012 19:04
-
-
Save jec006/3146043 to your computer and use it in GitHub Desktop.
'Enable' a module during unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fake enables a module for the purpose of a unit test | |
* | |
* @param $name | |
* The module's machine name (i.e. ctools not Chaos Tools) | |
*/ | |
protected function enableModule($name) { | |
$modules = module_list(); | |
$modules[$name] = $name; | |
module_list(TRUE, FALSE, FALSE, $modules); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment