You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be easier to extend PHPUnit's test runner. More importantly, it should be possible to do so without abusing the TestListener interface.
In a first step, two hooks should be implemented: one that is triggered before the first test is executed and one that is triggered after the last test is executed. This is simple enough to implement and has been requested a couple of times over the years.
Another possible hook could be test filtering and ordering for #2660.
Following the Interface Segregation Principle, the idea here is to avoid one big interface and instead have one interface per extension point at which extensions can hook into PHPUnit's test runner.
Here is an example of an extension that uses the two hooks mentioned above:
It should be easier to extend PHPUnit's test runner. More importantly, it should be possible to do so without abusing the
TestListener
interface.In a first step, two hooks should be implemented: one that is triggered before the first test is executed and one that is triggered after the last test is executed. This is simple enough to implement and has been requested a couple of times over the years.
Another possible hook could be test filtering and ordering for #2660.
I currently envision the following:
Following the Interface Segregation Principle, the idea here is to avoid one big interface and instead have one interface per extension point at which extensions can hook into PHPUnit's test runner.
Here is an example of an extension that uses the two hooks mentioned above:
Here is how you configure PHPUnit's test runner to use that extension:
The text was updated successfully, but these errors were encountered: