Also destruct TestCase objects early that use a data provider#5875
Closed
talkinnl wants to merge 1 commit intosebastianbergmann:10.5from
Closed
Also destruct TestCase objects early that use a data provider#5875talkinnl wants to merge 1 commit intosebastianbergmann:10.5from
TestCase objects early that use a data provider#5875talkinnl wants to merge 1 commit intosebastianbergmann:10.5from
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.
Owner
|
Thank you, Maarten. I guess this also solves @mvorisek's issue with |
Author
|
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. :) |
Author
|
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
Owner
|
Merged manually. |
Owner
Contributor
|
This is perfect and thank you @talkinnl! |
This was referenced Jun 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor unsetting tests during TestSuite::run, faster destruction.