phpunit-speedtrap
phpunit-speedtrap copied to clipboard
Switch over to using hooks instead of implementing deprecated TestListener
To allow compatibility with phpunit/phpunit:^9.0.0, for which the TestListener interface will have been removed, an implementation using hooks need to be developed.
For reference, see
- https://github.com/sebastianbergmann/phpunit/issues/3389
- https://github.com/sebastianbergmann/phpunit/issues/3390
I took a stab at this earlier, but it appears there's a bit of a challenge as the hooks only receive the name of the test, rather than the TestCase. That is, from the name of the test the test class and test need to be derived in order to introspect its annotations for determining whether the test is configured for a different threshold then the basic setting in phpunit.xml.
@localheinz Thank you for these details.
Looks like we will need a new major release and core logic to support PHPUnit 9.0. That version is set for release in February 2020.
Any chance you still have your implementation attempt? If so could you push it as a branch to your fork? I'm curious to see it and could offer some ideas.
Instant upgrade path https://github.com/rectorphp/rector/pull/1270
Looks like we will need a new major release and core logic to support PHPUnit 9.0. That version is set for release in February 2020.
That's not related. Hooks are actually supported since PHPUnit 7.1.
@johnkary what's the current state of this ticket? Is there anything we can help you with to get this fixed?
Also interested in regaining this awesome feature.
Anything we can do to facilitate progress? Does #83 need to be rebased?
Quick update: for those of you coming here and looking for an alternative that works with
phpunit/phpunit:^8.5.26phpunit/phpunit:^9.6.0phpunit/phpunit:^10.4.0
as well as
- PHP 7.4
- PHP 8.1
- PHP 8.2
- PHP 8.3
I just released ergebnis/phpunit-slow-test-detector:2.6.0 with support for all of these.