function ModuleTestBase::assertModules

Assert the list of modules are enabled or disabled.

Parameters

$modules: Module list to check.

$enabled: Expected module state.

8 calls to ModuleTestBase::assertModules()
DependencyTest::testEnableRequirementsFailureDependency in drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
Tests enabling a module that depends on a module which fails hook_requirements().
DependencyTest::testEnableWithoutDependency in drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
Attempts to enable the Entity Translation module without Language enabled.
DependencyTest::testMissingModules in drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
Attempts to enable a module with a missing dependency.
DependencyTest::testModuleEnableOrder in drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
Tests that module dependencies are enabled in the correct order via the UI. Dependencies should be enabled before their dependents.
DependencyTest::testUninstallDependents in drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
Tests attempting to uninstall a module that has installed dependents.

... See full list

File

drupal/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php, line 141
Definition of Drupal\system\Tests\Module\ModuleTestBase.

Class

ModuleTestBase
Helper class for module test cases.

Namespace

Drupal\system\Tests\Module

Code

function assertModules(array $modules, $enabled) {
  system_list_reset();
  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,
    )));
  }
}