Support the ongoing development of Laravel.io →
posted 6 years ago
Testing

Hai am new in laravel testing .I have facing below issue

  1. Tests\Feature\ApiTest::testnewhistory Expected status code 201 but received 200. Failed asserting that false is true.

Here is my code public function testnewhistory() { $response = $this->json('POST', '/api/testnewhistory', ['api_token' => 'addsdsd478d8sds5d5qwde5qwc5s5dcs4d4@1343w','userID'=>5]); //dd($response); $response ->assertStatus(201) ->assertJson([ 'message_staus' => '1', ]); } Please advice anyone .

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.