Total Complexity | 2 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class ProblemDetailsTest extends TestCase |
||
13 | { |
||
14 | /** |
||
15 | * @dataProvider provideCases |
||
16 | */ |
||
17 | public function testCreatesFromThrowable(\Throwable $throwable, string $expectedDetail, int $expectedStatus): void |
||
18 | { |
||
19 | $dto = ProblemDetails::fromThrowable($throwable); |
||
20 | |||
21 | $this->assertSame($expectedDetail, $dto->detail); |
||
22 | $this->assertSame($expectedStatus, $dto->status); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return \Generator<array> |
||
27 | */ |
||
28 | public function provideCases(): \Generator |
||
40 | ]; |
||
41 | } |
||
43 |