Skip to content

Compatibility phpunit48 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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"

},
Expand Down
2 changes: 1 addition & 1 deletion src/DispatcherWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand All @@ -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));
Expand All @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/ResultPrinter/UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
32 changes: 16 additions & 16 deletions src/phpunit5-loggers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand All @@ -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(
Expand All @@ -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(
Expand Down