-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Add filter in VarDumperTestTrait #22588
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
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.
👍
Note: in sf 4.0, methods signatures should be more elegant with // sf 3.x
public function assertDumpEquals($dump, $data, $message = '', $filter = 0)
public function assertDumpMatchesFormat($dump, $data, $message = '', $filter = 0)
// sf 4.0
public function assertDumpEquals($dump, $data, $filter = 0, $message = '')
public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') |
That's not possible without an upgrade path: we don't do hard BC breaks without notices first in 3.4. |
Like this? @trigger_error(sprintf('The $filter parameter of the %s() is deprecated since version 3.4 and will be moved at 3rd position in 4.0.', __METHOD__), E_USER_DEPRECATED); |
2768296
to
7fea536
Compare
@maidmaid you could detect when the type is int vs string and trigger a deprecation like in your example when relevant. |
Ok @nicolas-grekas, I will do this in an other PR. |
I'd prefer in the same PR, that's the same "unit of work" to me. |
dd48f24
to
9525b9a
Compare
Deprecation added. |
9525b9a
to
1da8e71
Compare
Thank you @maidmaid. |
This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] Add filter in VarDumperTestTrait | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | / | License | MIT | Doc PR | / Many casters uses ``EXCLUDE_*`` flags in their cast method. It would be usefull to use this flags directly with ``VarDumperTestTrait`` to tests many cases. Commits ------- 1da8e71 Add filter in VarDumperTestTrait
…idmaid) This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] Test ExceptionCaster excluding verbosity | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / Cover better ``ExceptionCaster`` in tests thanks to filter which was added in #22588. Commits ------- 85766c9 Add exculde verbosity test
…aidmaid) This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] Test ReflectionCaster excluding verbosity | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / Cover better ``ReflectionCaster`` in tests thanks to ``EXCLUDE_*`` filter which was added in #22588. Commits ------- e535089 Add exculde verbosity test
…aidmaid) This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] Test ReflectionCaster excluding verbosity | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / Cover better ``ReflectionCaster`` in tests thanks to ``EXCLUDE_*`` filter which was added in symfony/symfony#22588. Commits ------- e535089 Add exculde verbosity test
Many casters uses
EXCLUDE_*
flags in their cast method. It would be usefull to use this flags directly withVarDumperTestTrait
to tests many cases.