Chris@0: moduleList = [ Chris@0: 'system' => 0, Chris@0: 'simpletest' => 0, Chris@0: ]; Chris@0: $this->moduleData = [ Chris@0: 'system' => new Extension($this->root, 'module', 'core/modules/system/system.info.yml', 'system.module'), Chris@0: 'simpletest' => new Extension($this->root, 'module', 'core/modules/simpletest/simpletest.info.yml', 'simpletest.module'), Chris@0: ]; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function boot() { Chris@0: // Ensure that required Settings exist. Chris@0: if (!Settings::getAll()) { Chris@0: new Settings([ Chris@0: 'hash_salt' => 'run-tests', Chris@0: 'container_yamls' => [], Chris@0: // If there is no settings.php, then there is no parent site. In turn, Chris@0: // there is no public files directory; use a custom public files path. Chris@0: 'file_public_path' => 'sites/default/files', Chris@0: ]); Chris@0: } Chris@0: Chris@0: // Remove Drupal's error/exception handlers; they are designed for HTML Chris@0: // and there is no storage nor a (watchdog) logger here. Chris@0: restore_error_handler(); Chris@0: restore_exception_handler(); Chris@0: Chris@0: // In addition, ensure that PHP errors are not hidden away in logs. Chris@0: ini_set('display_errors', TRUE); Chris@0: Chris@0: parent::boot(); Chris@0: Chris@0: $this->getContainer()->get('module_handler')->loadAll(); Chris@0: Chris@0: $this->getContainer()->get('test_discovery')->registerTestNamespaces(); Chris@0: Chris@0: // Register stream wrappers. Chris@0: $this->getContainer()->get('stream_wrapper_manager')->register(); Chris@0: Chris@0: // Create the build/artifacts directory if necessary. Chris@0: include_once $this->getAppRoot() . '/core/includes/file.inc'; Chris@0: if (!is_dir('public://simpletest')) { Chris@0: mkdir('public://simpletest', 0777, TRUE); Chris@0: } Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function discoverServiceProviders() { Chris@0: parent::discoverServiceProviders(); Chris@0: // The test runner does not require an installed Drupal site to exist. Chris@0: // Therefore, its environment is identical to that of the early installer. Chris@0: $this->serviceProviderClasses['app']['Test'] = 'Drupal\Core\Installer\InstallerServiceProvider'; Chris@0: } Chris@0: Chris@0: }