[5.8] Prevent TestRespone dump methods from ending execution of the script #28960
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.
Greetings!
This is something that has been bothering me for quite some time so I propose a change.
TestResponse::dump()
andTestResponse::dumpHeaders()
methods actually usedd()
helper (instead ofdump()
) thus killing the execution of the script.Not only is this counter-intuitive, but also should be classified as a bug because it goes against the examples official documentation provides:
The way it's currently implemented this example from the docs won't even work properly, because only headers will be dumped and then the execution of the script will be halted. Making
TestResponse
dump methods to actually dump things likedump()
does would drastically improve tests' debugging experience out of the box (for now I've been registeringrealDump
macro forTestResponse
in my projects which is inconvenient).For those, who want previous behavior we can also discuss introducing
dd()
andddHeaders()
methods toTestResponse
class.