-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Also destruct TestCase
objects early that use a data provider
#5875
Conversation
…uction of instances. - Continuing on the destruction fix: The iterator also holds the array of tests. For tests with dataProviders, this results in not immediately destructing each Test, but only when the deeper TestSuite is done. - Refactored cleanup tricks: Just do a first loop so we no longer need properties nor the iterator, and then array_shift as we go. - Added test coverage.
Thank you, Maarten. I guess this also solves @mvorisek's issue with |
In #4705 (comment) , @mvorisek noted that his issue wasn't fixed yet. Seeing the order of events is easy, just add a __destruct() to TestCase which outputs a 'Z':
(Before that change, all Zs would be at the very end) WITH THIS PR 5875:
So a nice pattern between dots and Zs. :) |
phpunit own test suite:
TO
And then I added the test, so tests and assertions did increase. So no regressions, and a change from 42 to 40MB. |
TestCase
objects early that use a data provider
Merged manually. |
This is perfect and thank you @talkinnl! |
Refactor unsetting tests during TestSuite::run, faster destruction.