| Total Complexity | 2 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class GeolocationDbUpdateFailedExceptionTest extends TestCase |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @test |
||
| 17 | * @dataProvider provideCreateArgs |
||
| 18 | */ |
||
| 19 | public function createBuildsException(bool $olderDbExists, ?Throwable $prev): void |
||
| 20 | { |
||
| 21 | $e = GeolocationDbUpdateFailedException::create($olderDbExists, $prev); |
||
| 22 | |||
| 23 | self::assertEquals($olderDbExists, $e->olderDbExists()); |
||
| 24 | self::assertEquals( |
||
| 25 | 'An error occurred while updating geolocation database, and an older version could not be found', |
||
| 26 | $e->getMessage(), |
||
| 27 | ); |
||
| 28 | self::assertEquals(0, $e->getCode()); |
||
| 29 | self::assertEquals($prev, $e->getPrevious()); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function provideCreateArgs(): iterable |
||
| 38 | } |
||
| 39 | } |
||
| 40 |