You are here

protected function XAutoloadWebTestCase::xautoloadModuleEnabled in X Autoload 7.3

Same name and namespace in other branches
  1. 7.5 lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php \Drupal\xautoload\Tests\XAutoloadWebTestCase::xautoloadModuleEnabled()
  2. 7.4 lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php \Drupal\xautoload\Tests\XAutoloadWebTestCase::xautoloadModuleEnabled()
1 call to XAutoloadWebTestCase::xautoloadModuleEnabled()
XAutoloadWebTestCase::xautoloadCheckCacheMode in lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php

File

lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php, line 61

Class

XAutoloadWebTestCase

Namespace

Drupal\xautoload\Tests

Code

protected function xautoloadModuleEnabled($module, $classes, $classes_on_include) {
  $observation_function = '_' . $module . '_early_boot_observations';
  $observation_function('later');
  $all = $observation_function();
  foreach ($all as $phase => $observations) {
    $when = $phase === 'early' ? 'on drupal_load() during module_enable()' : ($phase === 'later' ? 'after hook_modules_enabled()' : 'at an undefined time');

    // Test the classes of the example module.
    foreach ($classes as $class) {

      // Test that the class was already found in $phase.
      if ($classes_on_include || $phase !== 'early') {
        $this
          ->assertTrue($observations[$class], "Class {$class} was found {$when}.");
      }
      else {
        $this
          ->assertFalse($observations[$class], "Class {$class} cannot be found {$when}.");
      }
    }
  }
}