From 0df7436f58ad912ca66a4a8192ec0fce3c3e71be Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Mon, 1 Jun 2020 20:17:38 +0900 Subject: [PATCH 1/2] Remove "Exception" type declation - https://github.com/php5friends/phpunit48/commit/6f897171bd55209f1128ccaa1e63342737c1084e --- src/DispatcherWrapper.php | 2 +- src/Listener.php | 10 +++++----- src/ResultPrinter/UI.php | 6 +++--- src/phpunit5-loggers.php | 32 ++++++++++++++++---------------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/DispatcherWrapper.php b/src/DispatcherWrapper.php index 5a9b014..258bfce 100644 --- a/src/DispatcherWrapper.php +++ b/src/DispatcherWrapper.php @@ -17,7 +17,7 @@ trait DispatcherWrapper protected function dispatch(EventDispatcher $dispatcher, $eventType, Event $eventObject) { //TraceableEventDispatcherInterface was introduced in symfony/event-dispatcher 2.5 and removed in 5.0 - if (!interface_exists(TraceableEventDispatcherInterface::class)) { + if (!interface_exists('\Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface')) { //Symfony 5 $dispatcher->dispatch($eventObject, $eventType); } else { diff --git a/src/Listener.php b/src/Listener.php index 5d31c92..7d3d3d4 100644 --- a/src/Listener.php +++ b/src/Listener.php @@ -31,11 +31,11 @@ public function __construct(EventDispatcher $dispatcher) * Risky test. * * @param PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time * @since Method available since Release 4.0.0 */ - public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time) { } @@ -45,7 +45,7 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass $this->fire(Events::TEST_FAIL, new FailEvent($test, $time, $e)); } - public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addError(\PHPUnit\Framework\Test $test, $e, $time) { $this->unsuccessfulTests[] = spl_object_hash($test); $this->fire(Events::TEST_ERROR, new FailEvent($test, $time, $e)); @@ -58,7 +58,7 @@ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\War $this->fire(Events::TEST_WARNING, new FailEvent($test, $time, $e)); } - public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time) { if (in_array(spl_object_hash($test), $this->skippedTests)) { return; @@ -68,7 +68,7 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $this->skippedTests[] = spl_object_hash($test); } - public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time) { if (in_array(spl_object_hash($test), $this->skippedTests)) { return; diff --git a/src/ResultPrinter/UI.php b/src/ResultPrinter/UI.php index 4d578a4..9a7de52 100644 --- a/src/ResultPrinter/UI.php +++ b/src/ResultPrinter/UI.php @@ -77,7 +77,7 @@ public function endTest(\PHPUnit\Framework\Test $test, $time) $this->lastTestFailed = false; } - public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addError(\PHPUnit\Framework\Test $test, $e, $time) { $this->lastTestFailed = true; } @@ -92,12 +92,12 @@ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\War $this->lastTestFailed = true; } - public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->lastTestFailed = true; } - public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->lastTestFailed = true; } diff --git a/src/phpunit5-loggers.php b/src/phpunit5-loggers.php index 554fddd..e2bb9b1 100644 --- a/src/phpunit5-loggers.php +++ b/src/phpunit5-loggers.php @@ -109,10 +109,10 @@ class JSON extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListe * An error occurred. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addError(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeCase( 'error', @@ -169,10 +169,10 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass * Incomplete test. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeCase( 'error', @@ -189,10 +189,10 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, * Risky test. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeCase( 'error', @@ -209,10 +209,10 @@ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time * Skipped test. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeCase( 'error', @@ -394,10 +394,10 @@ public function __construct($out = null) * An error occurred. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addError(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeNotOk($test, 'Error'); } @@ -460,10 +460,10 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass * Incomplete test. * * @param \PHPUnit\Framework\Test $test - * @param \Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->writeNotOk($test, '', 'TODO Incomplete Test'); } @@ -472,10 +472,10 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, * Risky test. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->write( sprintf( @@ -492,10 +492,10 @@ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time * Skipped test. * * @param \PHPUnit\Framework\Test $test - * @param Exception $e + * @param \Exception|\Throwable $e * @param float $time */ - public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time) { $this->write( sprintf( From fb587c4839702ecdd8e4ef92ae9cc55b1ebb4373 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Mon, 1 Jun 2020 20:20:18 +0900 Subject: [PATCH 2/2] Rename package --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 0fd57e4..0e18c2d 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "codeception/phpunit-wrapper", - "description": "PHPUnit classes used by Codeception", + "name": "php5friends/codeception-phpunit48-wrapper", + "description": "PHPUnit48 classes used by Codeception", "type": "library", "license": "MIT", "authors": [ @@ -13,9 +13,9 @@ "codeception/phpunit-wrapper": "*" }, "require": { - "phpunit/phpunit": ">=5.7.27 <6.5.13", - "phpunit/php-code-coverage": ">=4.0.4 <6.0", - "sebastian/comparator": ">=1.2.4 <3.0", + "php5friends/phpunit48": ">=4.8.40", + "phpunit/php-code-coverage": ">=2.2.4 <6.0", + "sebastian/comparator": "~1.2.4", "sebastian/diff": ">=1.4 <4.0" },