|
16 | 16 | use Chubbyphp\Mock\MockMethod\WithReturn; |
17 | 17 | use Chubbyphp\Mock\MockMethod\WithReturnSelf; |
18 | 18 | use Chubbyphp\Mock\MockObjectBuilder; |
19 | | -use Chubbyphp\Parsing\ParserErrorException; |
| 19 | +use Chubbyphp\Parsing\Error; |
| 20 | +use Chubbyphp\Parsing\ErrorsException; |
20 | 21 | use Chubbyphp\Parsing\Schema\ObjectSchemaInterface; |
21 | 22 | use PHPUnit\Framework\TestCase; |
22 | 23 | use Psr\Http\Message\ResponseFactoryInterface; |
@@ -122,7 +123,7 @@ public function testResourceNotFoundMissingModel(): void |
122 | 123 |
|
123 | 124 | public function testWithParsingError(): void |
124 | 125 | { |
125 | | - $parserErrorException = new ParserErrorException(); |
| 126 | + $errorsException = new ErrorsException(new Error('code', 'template', [])); |
126 | 127 |
|
127 | 128 | $inputAsStdClass = new \stdClass(); |
128 | 129 | $inputAsStdClass->name = 'test'; |
@@ -154,7 +155,7 @@ public function testWithParsingError(): void |
154 | 155 |
|
155 | 156 | /** @var ObjectSchemaInterface $modelRequestSchema */ |
156 | 157 | $modelRequestSchema = $builder->create(ObjectSchemaInterface::class, [ |
157 | | - new WithException('parse', [$inputAsArray], $parserErrorException), |
| 158 | + new WithException('parse', [$inputAsArray], $errorsException), |
158 | 159 | ]); |
159 | 160 |
|
160 | 161 | /** @var ParsingInterface $parsing */ |
@@ -192,7 +193,15 @@ public function testWithParsingError(): void |
192 | 193 | 'title' => 'Unprocessable Entity', |
193 | 194 | 'detail' => null, |
194 | 195 | 'instance' => null, |
195 | | - 'invalidParameters' => [], |
| 196 | + 'invalidParameters' => [ |
| 197 | + [ |
| 198 | + 'name' => '', |
| 199 | + 'reason' => 'template', |
| 200 | + 'details' => [ |
| 201 | + '_template' => 'template', |
| 202 | + ], |
| 203 | + ], |
| 204 | + ], |
196 | 205 | ], $e->jsonSerialize()); |
197 | 206 | } |
198 | 207 | } |
|
0 commit comments