R
R
Romi2022-03-12 17:02:19
Unit testing
Romi, 2022-03-12 17:02:19

I am writing phpunit tests for API - why does it always give 500 error instead of 404 or 403 in tests?

For example, I write: and it gives 404 according to the situation and in postman, for example, but when testing in the console, it writes And how can I display the error stack in general to see where exactly the error is, as when testing through a browser or postman? Is it even possible to do this in phpunit? Thank you.

$response->assertStatus(200);


Expected status code 200 but received 500.


Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question