Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function testCreate(): void |
||
17 | { |
||
18 | $violation = $this->getMockBuilder(ConstraintViolationInterface::class) |
||
19 | ->getMock(); |
||
20 | $violation->method('getPropertyPath') |
||
21 | ->willReturn('someProperty'); |
||
22 | $violation->method('getMessage') |
||
23 | ->willReturn('someMessage'); |
||
24 | |||
25 | $error = ErrorWithViolation::create($violation, 'someTitle'); |
||
26 | |||
27 | self::assertEquals( |
||
28 | [ |
||
29 | 'status' => 400, |
||
30 | 'title' => 'someTitle', |
||
31 | 'source' => [ |
||
32 | 'parameter' => 'someProperty', |
||
33 | 'message' => 'someMessage', |
||
34 | ], |
||
35 | ], |
||
36 | $error->getErrorData() |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 |