diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 1ecc40f..bb480f6 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -2,6 +2,7 @@ use Drupal\Core\Database\Database; use Drupal\simpletest\TestBase; +use Symfony\Component\Process\PhpExecutableFinder; /** * @file @@ -240,6 +241,12 @@ function simpletest_phpunit_configuration_filepath() { function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpunit_file) { $phpunit_bin = DRUPAL_ROOT . "/core/vendor/bin/phpunit"; + if (substr(PHP_OS, 0, 3) == 'WIN') { + $php_executable_finder = new PhpExecutableFinder(); + $php = $php_executable_finder->find(); + $phpunit_bin = escapeshellarg($php) . " -f " . escapeshellarg(DRUPAL_ROOT . "/core/vendor/phpunit/phpunit/composer/bin/phpunit") . " --"; + } + // Double escape namespaces so they'll work in a regexp. $escaped_test_classnames = array_map(function($class) { return addslashes($class);