DrupalEnvironment.php in X Autoload 7.5
File
tests/src/VirtualDrupal/DrupalEnvironment.php
View source
<?php
namespace Drupal\xautoload\Tests\VirtualDrupal;
use Drupal\xautoload\Tests\Mock\MockDrupalSystem;
class DrupalEnvironment {
private static $staticInstance;
private $components;
private $exampleModules;
function __construct(ExampleModulesInterface $exampleModules) {
$this->components = new DrupalComponentContainer($exampleModules);
$this->exampleModules = $exampleModules;
}
function setStaticInstance() {
self::$staticInstance = $this;
}
static function getInstance() {
return self::$staticInstance;
}
function getMockDrupalSystem() {
return $this->components->MockDrupalSystem;
}
function getCache() {
return $this->components->Cache;
}
function getSystemTable() {
return $this->components->SystemTable;
}
function moduleEnable(array $module_list, $enable_dependencies = TRUE) {
$this->components->ModuleEnable
->moduleEnable($module_list, $enable_dependencies);
}
public function boot() {
$this->components->DrupalBoot
->boot();
}
public function initBootstrapStatus() {
$bootstrap_modules = $this->exampleModules
->getBootstrapModules();
$this->components->SystemTable
->setBootstrapModules($bootstrap_modules);
}
public function librariesLoad($name) {
return $this->components->LibrariesLoad
->librariesLoad($name);
}
}