// 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.
if ($base_url) { putenv('SIMPLETEST_BASE_URL=' .
$base_url);
putenv('BROWSERTEST_OUTPUT_DIRECTORY=' .
$this->workingDirectory
);
} $phpunit_bin =
$this->
phpUnitCommand();
$command =
[ $phpunit_bin,
'--log-junit',
escapeshellarg($phpunit_file),
];
// Optimized for running a single test.
if (count($unescaped_test_classnames) == 1
) { $class =
new \
ReflectionClass($unescaped_test_classnames[0
]);
$command[] =
escapeshellarg($class->
getFileName());
}