diff --git a/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php b/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php index 3ac4253..cc101db 100644 --- a/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php +++ b/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php @@ -133,16 +133,16 @@ public function phpUnitCommand() { * The results as returned by exec(). */ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$status = NULL, &$output = NULL) { - // @todo Inject the base URL. global $base_url; // Setup an environment variable containing the database connection so that // functional tests can connect to the database. putenv('SIMPLETEST_DB=' . Database::getConnectionInfoAsUrl()); - // Setup an environment variable containing the base URL, if it is available. - // This allows functional tests to browse the site under test. When running - // tests via CLI, core/phpunit.xml.dist or core/scripts/run-tests.sh can set - // this variable. + // Setup an environment variable containing the base URL, if it is + // available. This allows functional tests to browse the site under test. + // When running tests via CLI, core/phpunit.xml.dist or + // core/scripts/run-tests.sh can set this variable. + // @todo Inject the base URL here and the caller can specify it. if ($base_url) { putenv('SIMPLETEST_BASE_URL=' . $base_url); } @@ -161,7 +161,7 @@ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$st } else { // Double escape namespaces so they'll work in a regexp. - $escaped_test_classnames = array_map(function($class) { + $escaped_test_classnames = array_map(function ($class) { return addslashes($class); }, $unescaped_test_classnames); @@ -177,10 +177,10 @@ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$st $old_cwd = getcwd(); chdir($this->appRoot . "/core"); - // exec in a subshell so that the environment is isolated when running tests - // via the simpletest UI. + // Execute in a subshell so that the environment is isolated when running + // tests via the simpletest UI. // @todo Convert to Symfony process framework. - $ret = exec(join($command, " "), $output, $status); + $ret = exec(implode(' ', $command), $output, $status); chdir($old_cwd); putenv('SIMPLETEST_DB=');