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

Suggestion: Show the generated Request object on --debug or -vvv #22

Closed
ThomasLandauer opened this issue Oct 22, 2020 · 4 comments
Closed

Comments

@ThomasLandauer
Copy link
Member

Follow up of Codeception/Codeception#5977 (comment)

Since Symfony Module doesn't perform an actual HTTP request, but rather generates a Symfony Request object, it would be nice to be able to dump this object somehow, to see what's actually in there.

@TavoNiievez
Copy link
Member

Hey @ThomasLandauer it would be quite useful!
Can you specify which attributes of the object you think would be useful for debugging? That object is relatively large and even has other nested objects, so if you can give a list of the ones that you think are most relevant, based on that comparison, I think it would help for the person who will implement this feature.

@ThomasLandauer
Copy link
Member Author

This is the object we're talking about, right? https://github.com/symfony/browser-kit/blob/v5.1.5/Request.php

Looking at the properties there, I'd say:

  • protected $uri; Just a string? => Show it!
  • protected $method; Just a string too? => Show it
  • protected $parameters; What is this? HTTP headers and stuff?
  • protected $files; Uploaded files?
  • protected $cookies; An array of strings? => Show it
  • protected $server; This I don't understand. Is this $_SERVER? But how can the client decide what the server looks like?
  • protected $content; HTTP body?

It's hard to say which one is unimportant ;-) How long would it be if you just dump it all? In general I'd say it's better to scroll through some lengthy output, rather than missing that one crucial information ;-)

@TavoNiievez TavoNiievez added the enhancement New feature or request label Nov 23, 2020
@TavoNiievez
Copy link
Member

@ThomasLandauer I was revisiting this issue to evaluate if it could be part of v2.0.

However, when reviewing the code, I noticed that this change should be implemented in innerbrowser and not in a module that extends from it, the reason is that we would have to do the same change in other modules like laravel. The symfony module should only worry about printing with --debug the things that are specific to the framework, such as the metrics that the Symfony Profiler provides.

For that reason, I am closing this issue in favor of Codeception/lib-innerbrowser#16, please edit the description there if you think that something of what was commented here is relevant for who decides to implement it.

@ThomasLandauer
Copy link
Member Author

Thanks - and sorry for opening the same thing twice! ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants