protected function XAutoloadWebTestCase::xautoloadModuleEnabled in X Autoload 7.5
Same name and namespace in other branches
- 7.3 lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php \Drupal\xautoload\Tests\XAutoloadWebTestCase::xautoloadModuleEnabled()
- 7.4 lib/Drupal/xautoload/Tests/XAutoloadWebTestCase.php \Drupal\xautoload\Tests\XAutoloadWebTestCase::xautoloadModuleEnabled()
Parameters
string $module:
string[] $classes:
bool $classes_on_include:
1 call to XAutoloadWebTestCase::xautoloadModuleEnabled()
- XAutoloadWebTestCase::xautoloadTestWithCacheTypes in lib/
Drupal/ xautoload/ Tests/ XAutoloadWebTestCase.php
File
- lib/
Drupal/ xautoload/ Tests/ XAutoloadWebTestCase.php, line 91
Class
Namespace
Drupal\xautoload\TestsCode
protected function xautoloadModuleEnabled($module, $classes, $classes_on_include) {
EnvironmentSnapshotMaker::takeSnapshot($module, 'later', $classes);
$all = EnvironmentSnapshotMaker::getSnapshots($module);
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.
$this
->assertTrue(isset($observations['class_exists'][$class]), "Class {$class} was checked {$when}.");
if ($classes_on_include || $phase !== 'early') {
$this
->assertTrue($observations['class_exists'][$class], "Class {$class} was found {$when}.");
}
else {
$this
->assertFalse($observations['class_exists'][$class], "Class {$class} cannot be found {$when}.");
}
}
}
}