Skip to content
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

Merged

Conversation

@ogizanagi
Copy link
Member

commented Jul 9, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
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.

@lyrixx
Copy link
Member

left a comment

I like it a lot

@lyrixx

lyrixx approved these changes Jul 9, 2019

Copy link
Member

left a comment

(I prefer when property declaration and their usage are sorted in the same order, but this is really a detail)

👍

@ogizanagi ogizanagi force-pushed the ogizanagi:feat/var-dumper/test-trait-setup branch from 0e53f95 to 2faf735 Jul 10, 2019

@ogizanagi ogizanagi force-pushed the ogizanagi:feat/var-dumper/test-trait-setup branch from 2faf735 to c6cd830 Jul 10, 2019

@ogizanagi ogizanagi force-pushed the ogizanagi:feat/var-dumper/test-trait-setup branch from c6cd830 to 1c5936a Jul 12, 2019

@ogizanagi

This comment has been minimized.

Copy link
Member Author

commented Jul 12, 2019

@nicolas-grekas : Better? :)

@ogizanagi ogizanagi force-pushed the ogizanagi:feat/var-dumper/test-trait-setup branch from 1c5936a to 2e68533 Jul 12, 2019

@ogizanagi ogizanagi force-pushed the ogizanagi:feat/var-dumper/test-trait-setup branch from 2e68533 to 613dbb2 Jul 15, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

Thank you @ogizanagi.

@nicolas-grekas nicolas-grekas merged commit 613dbb2 into symfony:4.4 Jul 17, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Jul 17, 2019

feature #32463 [VarDumper] Allow to configure VarDumperTestTrait cast…
…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

@ogizanagi ogizanagi deleted the ogizanagi:feat/var-dumper/test-trait-setup branch Jul 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.