From 33fd0d02f7a20f139f3a26677bdd28faa031aedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Es=CC=8Cler?= Date: Wed, 1 Mar 2023 09:10:00 +0100 Subject: [PATCH] support for phpunit 10 --- .gitignore | 2 +- README.md | 12 ++++++++++++ composer.json | 2 +- phpunit.xml | 7 +++++-- src/PHPUnit/Listener/GracefulInterruptListener.php | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d069e29..aff9154 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -vendor +/vendor composer.lock composer.phar diff --git a/README.md b/README.md index ac7b762..50a943c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,18 @@ A simple plug-in which allows to you interrupt running PHPUnit tests **gracefull ```bash composer require --dev esler/phpunit-graceful-interrupt ``` + +#### For PHPUnit >= 10 +```xml +Add extension to your `phpunit.xml` + + + + + +``` + +#### For PHPUnit < 10 Add listener to your `phpunit.xml` ```xml diff --git a/composer.json b/composer.json index 8940223..1134c82 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "ext-pcntl": "*", - "phpunit/phpunit": "^7.0||^8.0||^9.0" + "phpunit/phpunit": "^7.0||^8.0||^9.0||^10.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index ec70e44..293dd79 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,10 @@ - + + + + ./tests/unit/ diff --git a/src/PHPUnit/Listener/GracefulInterruptListener.php b/src/PHPUnit/Listener/GracefulInterruptListener.php index dfda880..d14a8b3 100644 --- a/src/PHPUnit/Listener/GracefulInterruptListener.php +++ b/src/PHPUnit/Listener/GracefulInterruptListener.php @@ -19,6 +19,9 @@ class GracefulInterruptListener implements TestListener { use TestListenerDefaultImplementation; + /** @var Test */ + private $test; + /** * Constructor */