diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 8123d08..936a88d 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -271,7 +271,6 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun $command = array( $phpunit_bin, - '-c ' . \Drupal::root() . '/core', '--log-junit', escapeshellarg($phpunit_file), ); @@ -294,10 +293,16 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun )); } + // Need to change directories before running the command so that we can use + // relative paths in the configuration file's exclusions. + $old_cwd = getcwd(); + chdir(\Drupal::root() . "/core"); + // exec in a subshell so that the environment is isolated when running tests // via the simpletest UI. - $ret = exec(join($command, ' '), $output, $status); + $ret = exec(join($command, " "), $output, $status); + chdir($old_cwd); putenv('SIMPLETEST_DB='); return $ret; }