I am new to Laravel and also unit testing in general.
I have written a simple test using the guide from Laravel,
public function testGet(){
$this->get('/api/accounts/1')->assertStatus(200)->assertJsonStructure([
'status','data'
]);
}
When the test is run, it generates the following failure (which is intended):
Time: 127 ms, Memory: 12.00MB
There was 1 failure:
1) Tests\Unit\AccountApiTest::testGet
Invalid JSON was returned from the route.
My question is, is there any way we can customize the message generated when a test fails for all the available assertion in Laravel? For this case, the message
Invalid JSON was returned from the route.