I've been writing some HTTP tests today and I've had an idea. I'm posting here to see if it's something others would be interested in..
Right now, when you're writing HTTP tests in Laravel and you want to dd (to debug the response), you'll have to assign your HTTP test chain to a variable and then do dd($response) or whatever.
This can sometimes be a bit annoying and tedious. Especially if you have methods that are added after the ->post(), like assertSee or assertRedirect as you have to comment those lines out, then add the semicolon into the right place. It's a faff (I think so anyway).
However, to get round this, maybe Laravel could have a ->dd() method on the HTTP testing chain? Similar to the way it works with Collections, where it would die dump the response body for debugging.
I've been writing some HTTP tests today and I've had an idea. I'm posting here to see if it's something others would be interested in..
Right now, when you're writing HTTP tests in Laravel and you want to
dd
(to debug the response), you'll have to assign your HTTP test chain to a variable and then dodd($response)
or whatever.This can sometimes be a bit annoying and tedious. Especially if you have methods that are added after the
->post()
, likeassertSee
orassertRedirect
as you have to comment those lines out, then add the semicolon into the right place. It's a faff (I think so anyway).However, to get round this, maybe Laravel could have a
->dd()
method on the HTTP testing chain? Similar to the way it works with Collections, where it would die dump the response body for debugging.Let me know what you think, if it's something people are interested in, I'm happy to look at PR'ing it into the framework.