function ModuleTestCase::assertModules
7.x system.test | ModuleTestCase::assertModules(array $modules, $enabled) |
Assert the list of modules are enabled or disabled.
Parameters
$modules: Module list to check.
$enabled: Expected module state.
8 calls to ModuleTestCase::assertModules()
- EnableDisableTestCase::assertSuccessfulDisableAndUninstall in drupal-7.x/
modules/ system/ system.test - Disables and uninstalls a module and asserts that it was done correctly.
- EnableDisableTestCase::testEnableDisable in drupal-7.x/
modules/ system/ system.test - Test that all core modules can be enabled, disabled and uninstalled.
- HookRequirementsTestCase::testHookRequirementsFailure in drupal-7.x/
modules/ system/ system.test - Assert that a module cannot be installed if it fails hook_requirements().
- ModuleDependencyTestCase::testEnableRequirementsFailureDependency in drupal-7.x/
modules/ system/ system.test - Tests enabling a module that depends on a module which fails hook_requirements().
- ModuleDependencyTestCase::testEnableWithoutDependency in drupal-7.x/
modules/ system/ system.test - Attempt to enable translation module without locale enabled.
File
- drupal-7.x/
modules/ system/ system.test, line 81 - Tests for system.module.
Class
- ModuleTestCase
- Helper class for module test cases.
Code
function assertModules(array $modules, $enabled) {
module_list(TRUE);
foreach ($modules as $module) {
if ($enabled) {
$message = 'Module "@module" is enabled.';
}
else {
$message = 'Module "@module" is not enabled.';
}
$this->assertEqual(module_exists($module), $enabled, format_string($message, array('@module' => $module)));
}
}