The TestSuite
value object returned by TestSuite\Filtered::testSuite()
contains all tests instead of only the filtered tests
#5641
Labels
feature/events
Issues related to PHPUnit's event system
status/waiting-for-feedback
Waiting for feedback from original reporter
type/bug
Something is broken
version/10
Something affects PHPUnit 10
Summary
I am implementing a
\PHPUnit\Event\TestSuite\FilteredSubscriber
. I want to use the list of tests provided by$event->testSuite()->tests()
to determine if a test database should be created or not. Currently we are always creating a test database, even when a developer might have provided a filter to run one or multiple unit tests which don't require a real database to be available. This 3 second delay because of the database creation becomes annoying.Current behavior
$event->testSuite()->tests()
is returning ALL tests, without any filtering applied.$event->testSuite()->count()
is returning the expected amount.How to reproduce
Implement an extension using the following code:
Expected behavior
I would expect
$event->testSuite()->tests()
to be returning only the tests which will be executed because of the provided filters.The text was updated successfully, but these errors were encountered: