Skip to content

Commit 753483e

Browse files
authored
Merge pull request #1 from nanasess/compatibility-phpunit48
Compatibility phpunit48
2 parents 7a871bd + fb587c4 commit 753483e

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

Diff for: composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "codeception/phpunit-wrapper",
3-
"description": "PHPUnit classes used by Codeception",
2+
"name": "php5friends/codeception-phpunit48-wrapper",
3+
"description": "PHPUnit48 classes used by Codeception",
44
"type": "library",
55
"license": "MIT",
66
"authors": [
@@ -13,9 +13,9 @@
1313
"codeception/phpunit-wrapper": "*"
1414
},
1515
"require": {
16-
"phpunit/phpunit": ">=5.7.27 <6.5.13",
17-
"phpunit/php-code-coverage": ">=4.0.4 <6.0",
18-
"sebastian/comparator": ">=1.2.4 <3.0",
16+
"php5friends/phpunit48": ">=4.8.40",
17+
"phpunit/php-code-coverage": ">=2.2.4 <6.0",
18+
"sebastian/comparator": "~1.2.4",
1919
"sebastian/diff": ">=1.4 <4.0"
2020

2121
},

Diff for: src/DispatcherWrapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait DispatcherWrapper
1717
protected function dispatch(EventDispatcher $dispatcher, $eventType, Event $eventObject)
1818
{
1919
//TraceableEventDispatcherInterface was introduced in symfony/event-dispatcher 2.5 and removed in 5.0
20-
if (!interface_exists(TraceableEventDispatcherInterface::class)) {
20+
if (!interface_exists('\Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface')) {
2121
//Symfony 5
2222
$dispatcher->dispatch($eventObject, $eventType);
2323
} else {

Diff for: src/Listener.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public function __construct(EventDispatcher $dispatcher)
3131
* Risky test.
3232
*
3333
* @param PHPUnit\Framework\Test $test
34-
* @param Exception $e
34+
* @param \Exception|\Throwable $e
3535
* @param float $time
3636
* @since Method available since Release 4.0.0
3737
*/
38-
public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
38+
public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time)
3939
{
4040
}
4141

@@ -45,7 +45,7 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass
4545
$this->fire(Events::TEST_FAIL, new FailEvent($test, $time, $e));
4646
}
4747

48-
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
48+
public function addError(\PHPUnit\Framework\Test $test, $e, $time)
4949
{
5050
$this->unsuccessfulTests[] = spl_object_hash($test);
5151
$this->fire(Events::TEST_ERROR, new FailEvent($test, $time, $e));
@@ -58,7 +58,7 @@ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\War
5858
$this->fire(Events::TEST_WARNING, new FailEvent($test, $time, $e));
5959
}
6060

61-
public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
61+
public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time)
6262
{
6363
if (in_array(spl_object_hash($test), $this->skippedTests)) {
6464
return;
@@ -68,7 +68,7 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e,
6868
$this->skippedTests[] = spl_object_hash($test);
6969
}
7070

71-
public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
71+
public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time)
7272
{
7373
if (in_array(spl_object_hash($test), $this->skippedTests)) {
7474
return;

Diff for: src/ResultPrinter/UI.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
7777
$this->lastTestFailed = false;
7878
}
7979

80-
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
80+
public function addError(\PHPUnit\Framework\Test $test, $e, $time)
8181
{
8282
$this->lastTestFailed = true;
8383
}
@@ -92,12 +92,12 @@ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\War
9292
$this->lastTestFailed = true;
9393
}
9494

95-
public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
95+
public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time)
9696
{
9797
$this->lastTestFailed = true;
9898
}
9999

100-
public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
100+
public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time)
101101
{
102102
$this->lastTestFailed = true;
103103
}

Diff for: src/phpunit5-loggers.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class JSON extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListe
109109
* An error occurred.
110110
*
111111
* @param \PHPUnit\Framework\Test $test
112-
* @param Exception $e
112+
* @param \Exception|\Throwable $e
113113
* @param float $time
114114
*/
115-
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
115+
public function addError(\PHPUnit\Framework\Test $test, $e, $time)
116116
{
117117
$this->writeCase(
118118
'error',
@@ -169,10 +169,10 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass
169169
* Incomplete test.
170170
*
171171
* @param \PHPUnit\Framework\Test $test
172-
* @param Exception $e
172+
* @param \Exception|\Throwable $e
173173
* @param float $time
174174
*/
175-
public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
175+
public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time)
176176
{
177177
$this->writeCase(
178178
'error',
@@ -189,10 +189,10 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e,
189189
* Risky test.
190190
*
191191
* @param \PHPUnit\Framework\Test $test
192-
* @param Exception $e
192+
* @param \Exception|\Throwable $e
193193
* @param float $time
194194
*/
195-
public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
195+
public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time)
196196
{
197197
$this->writeCase(
198198
'error',
@@ -209,10 +209,10 @@ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time
209209
* Skipped test.
210210
*
211211
* @param \PHPUnit\Framework\Test $test
212-
* @param Exception $e
212+
* @param \Exception|\Throwable $e
213213
* @param float $time
214214
*/
215-
public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
215+
public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time)
216216
{
217217
$this->writeCase(
218218
'error',
@@ -394,10 +394,10 @@ public function __construct($out = null)
394394
* An error occurred.
395395
*
396396
* @param \PHPUnit\Framework\Test $test
397-
* @param Exception $e
397+
* @param \Exception|\Throwable $e
398398
* @param float $time
399399
*/
400-
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
400+
public function addError(\PHPUnit\Framework\Test $test, $e, $time)
401401
{
402402
$this->writeNotOk($test, 'Error');
403403
}
@@ -460,10 +460,10 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass
460460
* Incomplete test.
461461
*
462462
* @param \PHPUnit\Framework\Test $test
463-
* @param \Exception $e
463+
* @param \Exception|\Throwable $e
464464
* @param float $time
465465
*/
466-
public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
466+
public function addIncompleteTest(\PHPUnit\Framework\Test $test, $e, $time)
467467
{
468468
$this->writeNotOk($test, '', 'TODO Incomplete Test');
469469
}
@@ -472,10 +472,10 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e,
472472
* Risky test.
473473
*
474474
* @param \PHPUnit\Framework\Test $test
475-
* @param Exception $e
475+
* @param \Exception|\Throwable $e
476476
* @param float $time
477477
*/
478-
public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
478+
public function addRiskyTest(\PHPUnit\Framework\Test $test, $e, $time)
479479
{
480480
$this->write(
481481
sprintf(
@@ -492,10 +492,10 @@ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time
492492
* Skipped test.
493493
*
494494
* @param \PHPUnit\Framework\Test $test
495-
* @param Exception $e
495+
* @param \Exception|\Throwable $e
496496
* @param float $time
497497
*/
498-
public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
498+
public function addSkippedTest(\PHPUnit\Framework\Test $test, $e, $time)
499499
{
500500
$this->write(
501501
sprintf(

0 commit comments

Comments
 (0)