mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Restore error details in JSON-API error formatter
Fixes #1865. Refs #1843.
This commit is contained in:
@@ -58,6 +58,32 @@ class CreationTest extends TestCase
|
||||
);
|
||||
|
||||
$this->assertEquals(422, $response->getStatusCode());
|
||||
|
||||
// The response body should contain details about the failed validation
|
||||
$body = (string) $response->getBody();
|
||||
$this->assertJson($body);
|
||||
$this->assertEquals([
|
||||
'errors' => [
|
||||
[
|
||||
'status' => '422',
|
||||
'code' => 'validation_error',
|
||||
'detail' => 'validation.required',
|
||||
'source' => ['pointer' => '/data/attributes/username'],
|
||||
],
|
||||
[
|
||||
'status' => '422',
|
||||
'code' => 'validation_error',
|
||||
'detail' => 'validation.required',
|
||||
'source' => ['pointer' => '/data/attributes/email'],
|
||||
],
|
||||
[
|
||||
'status' => '422',
|
||||
'code' => 'validation_error',
|
||||
'detail' => 'validation.required',
|
||||
'source' => ['pointer' => '/data/attributes/password'],
|
||||
],
|
||||
],
|
||||
], json_decode($body, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user