It seems the $response->assertHasError(409); fails as it is trying to match a subset of the response document with "status" as an integer, but the JSON-API spec requires the error "status" to be a string.
Output of test:
Failed asserting that the array at [/errors] contains the subset:
within JSON API document:
{
"errors": [
{
"detail": "Blah blah blah",
"status": "409",
"title": "Some Conflict"
}
]
}.
Currently the assertHasError method will only take $status as an int:
public function assertHasError(int $status, array $error = [], bool $strict = true): self
It seems the
$response->assertHasError(409);fails as it is trying to match a subset of the response document with "status" as an integer, but the JSON-API spec requires the error "status" to be a string.Output of test:
Failed asserting that the array at [/errors] contains the subset:
{ "status": 409 }within JSON API document:
{ "errors": [ { "detail": "Blah blah blah", "status": "409", "title": "Some Conflict" } ] }.Currently the assertHasError method will only take $status as an int: