diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 66172404a6..9fe4bff2f7 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -148,8 +148,7 @@ exit(SIMPLETEST_SCRIPT_EXIT_SUCCESS); } -simpletest_script_print("PHP version: " . phpversion(), SIMPLETEST_SCRIPT_COLOR_PASS); -simpletest_script_print("PHPUnit version: " . Version::id(), SIMPLETEST_SCRIPT_COLOR_PASS); +simpletest_script_print("PHP version: " . phpversion() . " - PHPUnit version: " . Version::id() . "\n", SIMPLETEST_SCRIPT_COLOR_PASS); //if (!Composer::upgradePHPUnitCheck(Version::id())) { // simpletest_script_print_error("PHPUnit testing framework version 10 or greater is required when running on PHP 8.1 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."); // exit(SIMPLETEST_SCRIPT_EXIT_FAILURE); diff --git a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php index 7f92b9ed00..16041b4846 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php @@ -4,6 +4,7 @@ use Behat\Mink\Exception\DriverException; use Drupal\Tests\BrowserTestBase; +use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion; use PHPUnit\Runner\BaseTestRunner; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -92,10 +93,14 @@ protected function initFrontPage() { */ protected function tearDown(): void { if ($this->mink) { - $status = $this->getStatus(); - if ($status === BaseTestRunner::STATUS_ERROR || $status === BaseTestRunner::STATUS_WARNING || $status === BaseTestRunner::STATUS_FAILURE) { - // Ensure we capture the output at point of failure. - @$this->htmlOutput(); + // @todo ::getStatus was removed from PHPUnit 10, we probably need to + // intercept an event instead. + if (RunnerVersion::getMajor < 10) { + $status = $this->getStatus(); + if ($status === BaseTestRunner::STATUS_ERROR || $status === BaseTestRunner::STATUS_WARNING || $status === BaseTestRunner::STATUS_FAILURE) { + // Ensure we capture the output at point of failure. + @$this->htmlOutput(); + } } // Wait for all requests to finish. It is possible that an AJAX request is // still on-going. diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index 117feca86c..0413616ac7 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -1,5 +1,7 @@