-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Allow to configure VarDumperTestTrait casters & flags #32463
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
[VarDumper] Allow to configure VarDumperTestTrait casters & flags #32463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I prefer when property declaration and their usage are sorted in the same order, but this is really a detail)
👍
@nicolas-grekas : Better? :) |
Thank you @ogizanagi. |
…ers & flags (ogizanagi) This PR was merged into the 4.4 branch. Discussion ---------- [VarDumper] Allow to configure VarDumperTestTrait casters & flags | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | N/A <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | TODO: showcase using `setUpVarDumper` in `setUp` or in specific test cases accordingly to the use-case. `tearDownVarDumper` is automatically called after each test case. The VarDumper component is a great tool in tests to assert objects states. The ability to register custom casters on need is a nice way to control only the fields you're expecting, or a way to write concise test cases. Hence this feature allowing to configure casters specifically per test class/case. Commits ------- 613dbb2 [VarDumper] Allow to configure VarDumperTestTrait casters & flags
setUpVarDumper
insetUp
or in specific test cases accordingly to the use-case.tearDownVarDumper
is automatically called after each test case.The VarDumper component is a great tool in tests to assert objects states.
The ability to register custom casters on need is a nice way to control only the fields you're expecting, or a way to write concise test cases.
Hence this feature allowing to configure casters specifically per test class/case.