diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index d1bb1e3..efdb851 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -116,7 +116,7 @@ * * @var boolean */ - protected $verbose = FALSE; + public $verbose = FALSE; /** * Incrementing identifier for verbose output filenames. @@ -744,7 +744,7 @@ public function run(array $methods = array()) { $simpletest_config = \Drupal::config('simpletest.settings'); $class = get_class($this); - if ($simpletest_config->get('verbose')) { + if ($this->verbose || $simpletest_config->get('verbose')) { // Initialize verbose debugging. $this->verbose = TRUE; $this->verboseDirectory = PublicStream::basePath() . '/simpletest/verbose'; @@ -916,6 +916,8 @@ protected function prepareEnvironment() { drupal_valid_test_ua($this->databasePrefix); } + $this->globalConfig = GlobalConfig::getInstance(); + // Backup current in-memory configuration. $this->originalSettings = settings()->getAll(); $this->originalConfig = $this->globalConfig->getAll(); @@ -969,8 +971,6 @@ protected function prepareEnvironment() { // Create and set new configuration directories. $this->prepareConfigDirectories(); - $this->globalConfig = GlobalConfig::getInstance(); - // Reset statics before the old container is replaced so that objects with a // __destruct() method still have access to it. // @todo: Remove once they have been converted to services. diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 9538c96..8a7c0e2 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -6,7 +6,6 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use Drupal\Core\Config\GlobalConfig; use Drupal\Core\StreamWrapper\PublicStream; const SIMPLETEST_SCRIPT_COLOR_PASS = 32; // Green. @@ -496,13 +495,9 @@ function simpletest_script_run_one_test($test_id, $test_class) { $container = \Drupal::getContainer(); $container->set('request', $request); - // Override configuration according to command line parameters. - $config = GlobalConfig::getInstance(); - $config->set('simpletest.settings', 'verbose', $args['verbose']); - $config->set('simpletest.settings', 'clear_results', !$args['keep-results']); - $test = new $test_class($test_id); $test->dieOnFail = (bool) $args['die-on-fail']; + $test->verbose = (bool) $args['verbose']; $test->run(); $info = $test->getInfo();