Issue #2248845 by sun: Fixed [run-tests.sh] simpletest_phpunit_xml_filepath() depends on public:// stream wrapper.

8.0.x
Alex Pott 2014-08-19 16:21:58 +01:00
parent dd4fd1ac24
commit 234382b6db
2 changed files with 13 additions and 1 deletions

View File

@ -55,6 +55,9 @@ class TestRunnerKernel extends DrupalKernel {
if (!Settings::getAll()) {
new Settings(array(
'hash_salt' => 'run-tests',
// If there is no settings.php, then there is no parent site. In turn,
// there is no public files directory; use a custom public files path.
'file_public_path' => 'sites/default/files',
));
}
@ -71,6 +74,13 @@ class TestRunnerKernel extends DrupalKernel {
$this->getContainer()->get('module_handler')->loadAll();
simpletest_classloader_register();
// Register System module stream wrappers and create the build/artifacts
// directory if necessary.
file_get_stream_wrappers();
if (!is_dir('public://simpletest')) {
mkdir('public://simpletest', 0777, TRUE);
}
}
/**

View File

@ -205,7 +205,9 @@ function simpletest_process_phpunit_results($phpunit_results) {
// Insert the results of the PHPUnit test run into the database so the results
// are displayed along with Simpletest's results.
if (!empty($phpunit_results)) {
$query = db_insert('simpletest')->fields(array_keys($phpunit_results[0]));
$query = TestBase::getDatabaseConnection()
->insert('simpletest')
->fields(array_keys($phpunit_results[0]));
foreach ($phpunit_results as $result) {
$query->values($result);
}