[VarDumper][PhpUnitBridge] VarDumperServerListener #26696
Closed
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.
Based on previous PR (#26695) about easy server dumper as main handler registration.
Keeping exploring different usages for the server dumper feature, this provides a PhpUnit listener you can configure to automatically register the server dumper (allowing to get better context about dumps, cli & html format & avoid mixing the test suite output with wild cli dumps).
Considering the following changes in the symfony-demo
running
vendor/bin/simple-phpunit --filter=BlogControllerTest::testIndex
and with server up will generate:giving proper context about the test case in dedicated output instead of this mess:
(of course the output is quite simple here)
However, by setting the
debug.dump_destination:
on test env too, and by not locking the handler from the PhpUnit listener, you'll get better context about the controller's dump:but right after the request is executed, the server dumper in use still is the one registered by the
DebugBundle
, so we're now loosing the PhpUnit context.So, right now, I don't know how to get the best of both worlds. ogizanagi@23a80bb is an attempt to this, but is not bullet-proof.
Any feedback welcome.