Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class InvalidUrlExceptionTest extends TestCase |
||
12 | { |
||
13 | /** |
||
14 | * @test |
||
15 | * @dataProvider providePrevious |
||
16 | */ |
||
17 | public function properlyCreatesExceptionFromUrl(?Throwable $prev) |
||
18 | { |
||
19 | $e = InvalidUrlException::fromUrl('http://the_url.com', $prev); |
||
20 | |||
21 | $this->assertEquals('Provided URL "http://the_url.com" is not an existing and valid URL', $e->getMessage()); |
||
22 | $this->assertEquals($prev !== null ? $prev->getCode() : -1, $e->getCode()); |
||
23 | $this->assertEquals($prev, $e->getPrevious()); |
||
24 | } |
||
25 | |||
26 | public function providePrevious(): array |
||
31 | ]; |
||
32 | } |
||
34 |