Skip to content

Commit 33fd0d0

Browse files
author
Ondřej Ešler
committed
support for phpunit 10
1 parent e67c0e6 commit 33fd0d0

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
vendor
1+
/vendor
22
composer.lock
33
composer.phar

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ A simple plug-in which allows to you interrupt running PHPUnit tests **gracefull
55
```bash
66
composer require --dev esler/phpunit-graceful-interrupt
77
```
8+
9+
#### For PHPUnit >= 10
10+
```xml
11+
Add extension to your `phpunit.xml`
12+
<phpunit>
13+
<extensions>
14+
<bootstrap class="Esler\PHPUnit\GracefulInterruptExtension" />
15+
</extensions>
16+
</phpunit>
17+
```
18+
19+
#### For PHPUnit < 10
820
Add listener to your `phpunit.xml`
921
```xml
1022
<phpunit>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"ext-pcntl": "*",
16-
"phpunit/phpunit": "^7.0||^8.0||^9.0"
16+
"phpunit/phpunit": "^7.0||^8.0||^9.0||^10.0"
1717
},
1818
"autoload": {
1919
"psr-4": {

phpunit.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<phpunit>
2-
<listeners>
2+
<!-- <listeners>
33
<listener class="Esler\PHPUnit\Listener\GracefulInterruptListener" file="./src/PHPUnit/Listener/GracefulInterruptListener.php" />
4-
</listeners>
4+
</listeners> -->
5+
<extensions>
6+
<bootstrap class="Esler\PHPUnit\GracefulInterruptExtension" />
7+
</extensions>
58
<testsuites>
69
<testsuite name="Fake testsuite">
710
<directory>./tests/unit/</directory>

src/PHPUnit/Listener/GracefulInterruptListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class GracefulInterruptListener implements TestListener
1919
{
2020
use TestListenerDefaultImplementation;
2121

22+
/** @var Test */
23+
private $test;
24+
2225
/**
2326
* Constructor
2427
*/

0 commit comments

Comments
 (0)