If you're using Codeception as a testing framework for your Laravel app, you may find yourself wanting to use some of the familiar Laravel testing assertions that you can find in Illuminate\Testing\TestResponse. I assume you're already using both Laravel and Codeception, so I won't go down the road of helping you set those up.
First let's head over to routes/api.php and add the following: If we were to use Laravel's built in test suite, we'd probably write the following feature test: How can we replicate this in Codeception?
We'll use this getLaravelResponse method in our Codeception tests to gain access to a number of familiar Laravel assertions such as assertSuccessful or assertJson.
Our Codeception test now looks and feels similar to our Laravel test.