Sometimes, when running integration tests using Laravel and PHPUnit, it’s useful to inspect the response when you can’t figure out why the test is failing. In Laravel 5 and later versions, testing has been highly improved with an API that allows nice and fluent interaction with your application.
Inspect the Response Object
In Laravel, each Test extends the default abstract
TestCase class defined in
Illuminate\Foundation\Testing. This class uses the
CrawlerTrait to …