diff --git a/core/lib/Drupal/Core/Test/JUnitConverter.php b/core/lib/Drupal/Core/Test/JUnitConverter.php index 27364b1..8ae08a0 100644 --- a/core/lib/Drupal/Core/Test/JUnitConverter.php +++ b/core/lib/Drupal/Core/Test/JUnitConverter.php @@ -29,7 +29,7 @@ class JUnitConverter { public static function xmlToRows($test_id, $phpunit_xml_file) { $contents = @file_get_contents($phpunit_xml_file); if (!$contents) { - return; + return []; } $records = array(); $testcases = static::findTestcases(new \SimpleXMLElement($contents)); diff --git a/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php b/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php index f473ed6..b9c507e 100644 --- a/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php +++ b/core/lib/Drupal/Core/Test/PhpUnitTestRunner.php @@ -1,10 +1,5 @@ phpUnitCommand(); $command = array( @@ -178,6 +184,9 @@ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$st chdir($old_cwd); putenv('SIMPLETEST_DB='); + if ($base_url) { + putenv('SIMPLETEST_BASE_URL='); + } return $ret; } diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php index 9677dca..d283a6d 100644 --- a/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php +++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php @@ -1,10 +1,5 @@ getMockBuilder(PhpUnitTestRunner::class) ->disableOriginalConstructor() @@ -56,14 +51,14 @@ function ($unescaped_test_classnames, $phpunit_file, &$status) { // A serious error in runCommand() should give us a fixed set of results. $row = reset($results); $fail_row = [ - 'test_id' => '1', - 'test_class' => 'SomeTest', - 'status' => 'fail', - 'message' => 'PHPunit Test failed to complete', - 'message_group' => 'Other', - 'function' => 'SomeTest', - 'line' => '0', - 'file' => $log_path, + 'test_id' => '1', + 'test_class' => 'SomeTest', + 'status' => 'fail', + 'message' => 'PHPunit Test failed to complete', + 'message_group' => 'Other', + 'function' => 'SomeTest', + 'line' => '0', + 'file' => $log_path, ]; $this->assertEquals($fail_row, $row); }