Commit 234382b6 authored by alexpott's avatar alexpott

Issue #2248845 by sun: Fixed [run-tests.sh] simpletest_phpunit_xml_filepath()...

Issue #2248845 by sun: Fixed [run-tests.sh] simpletest_phpunit_xml_filepath() depends on public:// stream wrapper.
parent dd4fd1ac
......@@ -55,6 +55,9 @@ public function boot() {
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 @@ public function boot() {
$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);
}
}
/**
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment