Total Complexity | 5 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class UrlTest extends TestCase |
||
12 | { |
||
13 | /** |
||
14 | * @test |
||
15 | * @covers ::filter |
||
16 | */ |
||
17 | public function filter() |
||
18 | { |
||
19 | $url = 'http://www.example.com'; |
||
20 | $this->assertSame($url, Url::filter($url)); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @test |
||
25 | * @covers ::filter |
||
26 | */ |
||
27 | public function filterNonString() |
||
28 | { |
||
29 | $this->expectException(\TraderInteractive\Exceptions\FilterException::class); |
||
30 | $this->expectExceptionMessage("Value '1' is not a string"); |
||
31 | Url::filter(1); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @test |
||
36 | * @covers ::filter |
||
37 | */ |
||
38 | public function filterNotValid() |
||
39 | { |
||
40 | $this->expectException(\TraderInteractive\Exceptions\FilterException::class); |
||
41 | $this->expectExceptionMessage("Value 'www.example.com' is not a valid url"); |
||
42 | Url::filter('www.example.com'); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @test |
||
47 | * @covers ::filter |
||
48 | */ |
||
49 | public function filterNullPass() |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @test |
||
56 | * @covers ::filter |
||
57 | */ |
||
58 | public function filterNullFail() |
||
63 | } |
||
64 | } |
||
65 |