1 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.

File

core/modules/system/tests/system.test, line 84
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)));
  }
}