Skip to content
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

Switch over to using hooks instead of implementing deprecated TestListener #60

Closed
localheinz opened this issue Apr 30, 2019 · 5 comments
Milestone

Comments

@localheinz
Copy link
Contributor

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

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.

@johnkary
Copy link
Owner

@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.

@johnkary johnkary added this to the 4.0 milestone Jun 28, 2019
@TomasVotruba
Copy link

Instant upgrade path rectorphp/rector#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.

@NicoHaase
Copy link

@johnkary what's the current state of this ticket? Is there anything we can help you with to get this fixed?

@beporter
Copy link

beporter commented Jan 3, 2022

Also interested in regaining this awesome feature.

Anything we can do to facilitate progress? Does #83 need to be rebased?

@localheinz
Copy link
Contributor Author

Quick update: for those of you coming here and looking for an alternative that works with

  • phpunit/phpunit:^8.5.26
  • phpunit/phpunit:^9.6.0
  • phpunit/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants