php - Laravel route and controller testing -


so trying test routes , controller functions have created. other routes return views work fine, , told professor test routes putting vardump in controller function pointing to.

now, doesn't make sense me, because functions never return view or ui data, return json responses.

am correct there no way test routes using vardumps? confused here.

when developing rest api's laravel (which tend return json default), use postman client testing. var_dump() pretty ugly when looking @ response if have xdebug installed (which do), tend use print_r instead.

for example, morning testing out, added line in controller:

print_r($files); exit; 

and postman showed me:

enter image description here

you can use var_dump if choose to. if don't include exit() statement, application continue run , depending , how have things setup, may more looking for. me, easier dump need , stop application can see need to.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -