0

I can't figure this one out in PHPUnit. In Postman it works well but in PHPUnit there is an error.

class MyPageTakumoiTest extends TestCase
{
    protected $api = "/api/my_page_takumoi/2";

    public function testUpdate()
    {

        $response = $this->json('PUT', $this->api, [
            'family_name' => 'new kk',
        ]);

        $response->assertStatus(200);

    }
}

Expected status code 200 but received 500.
Failed asserting that 200 is identical to 500.

enter image description here

1
  • Do you have some logs? Status 500 is a generic error status... Commented May 18, 2020 at 12:35

1 Answer 1

1

You can use this at the start of your test to get a better exception:

$this->withoutExceptionHandling();
Sign up to request clarification or add additional context in comments.

1 Comment

It's not the answer but it works like an answer. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.