From 10e66ccdad397200f8129a034f0d3bf8cbe4c524 Mon Sep 17 00:00:00 2001 From: Filippo Tessarotto Date: Mon, 20 Mar 2023 16:15:41 +0100 Subject: [PATCH] Update PHPUnit compatibility to 10.0.17 (#744) --- composer.json | 6 +++--- src/WrapperRunner/ApplicationForWrapperWorker.php | 15 +++++++++++---- src/WrapperRunner/WrapperRunner.php | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ea61867d..b96c7e40 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "phpunit/php-code-coverage": "^10.0.2", "phpunit/php-file-iterator": "^4.0.1", "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.0.16", + "phpunit/phpunit": "^10.0.17", "sebastian/environment": "^6.0", "symfony/console": "^6.2.7", "symfony/process": "^6.2.7" @@ -53,8 +53,8 @@ "ext-posix": "*", "doctrine/coding-standard": "^11.1.0", "infection/infection": "^0.26.19", - "phpstan/phpstan": "^1.10.6", - "phpstan/phpstan-deprecation-rules": "^1.1.2", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", "phpstan/phpstan-phpunit": "^1.3.10", "phpstan/phpstan-strict-rules": "^1.5", "squizlabs/php_codesniffer": "^3.7.2", diff --git a/src/WrapperRunner/ApplicationForWrapperWorker.php b/src/WrapperRunner/ApplicationForWrapperWorker.php index cdf501a4..a0a100db 100644 --- a/src/WrapperRunner/ApplicationForWrapperWorker.php +++ b/src/WrapperRunner/ApplicationForWrapperWorker.php @@ -118,25 +118,32 @@ private function bootstrap(): void CodeCoverage::instance()->init($this->configuration, CodeCoverageFilterRegistry::instance()); if ($this->configuration->hasLogfileJunit()) { - new JunitXmlLogger(DefaultPrinter::from($this->configuration->logfileJunit())); + new JunitXmlLogger( + DefaultPrinter::from($this->configuration->logfileJunit()), + EventFacade::instance(), + ); } new ProgressPrinter( DefaultPrinter::from($this->progressFile), false, 120, + EventFacade::instance(), ); if (isset($this->teamcityFile)) { - new TeamCityLogger(DefaultPrinter::from($this->teamcityFile)); + new TeamCityLogger( + DefaultPrinter::from($this->teamcityFile), + EventFacade::instance(), + ); } if (isset($this->testdoxFile)) { - $this->testdoxResultCollector = new TestResultCollector(); + $this->testdoxResultCollector = new TestResultCollector(EventFacade::instance()); } TestResultFacade::init(); - EventFacade::seal(); + EventFacade::instance()->seal(); EventFacade::emitter()->testRunnerStarted(); if ($this->configuration->executionOrder() === TestSuiteSorter::ORDER_RANDOMIZED) { diff --git a/src/WrapperRunner/WrapperRunner.php b/src/WrapperRunner/WrapperRunner.php index 6982d818..a42ceaef 100644 --- a/src/WrapperRunner/WrapperRunner.php +++ b/src/WrapperRunner/WrapperRunner.php @@ -99,7 +99,7 @@ public function run(): int assert($directory !== ''); ExcludeList::addDirectory($directory); TestResultFacade::init(); - EventFacade::seal(); + EventFacade::instance()->seal(); $suiteLoader = new SuiteLoader( $this->options, $this->output,