| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function properlyCreatesExceptionFromNotFoundShortCode( |
||
| 17 | string $expectedMessage, |
||
| 18 | string $shortCode, |
||
| 19 | ?string $domain |
||
| 20 | ): void { |
||
| 21 | $expectedAdditional = ['shortCode' => $shortCode]; |
||
| 22 | if ($domain !== null) { |
||
| 23 | $expectedAdditional['domain'] = $domain; |
||
| 24 | } |
||
| 25 | |||
| 26 | $e = ShortUrlNotFoundException::fromNotFoundShortCode($shortCode, $domain); |
||
| 27 | |||
| 28 | $this->assertEquals($expectedMessage, $e->getMessage()); |
||
| 29 | $this->assertEquals($expectedMessage, $e->getDetail()); |
||
| 30 | $this->assertEquals('Short URL not found', $e->getTitle()); |
||
| 31 | $this->assertEquals('INVALID_SHORTCODE', $e->getType()); |
||
| 32 | $this->assertEquals(404, $e->getStatus()); |
||
| 33 | $this->assertEquals($expectedAdditional, $e->getAdditionalData()); |
||
| 34 | } |
||
| 50 |