Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function testMatch() |
||
27 | { |
||
28 | $filter = new AllowedSchemeFilter(array('http')); |
||
29 | |||
30 | $currentUri = 'http://php-spider.org'; |
||
31 | $uri = new Uri('http://php-spider.org'); |
||
32 | $uri2 = new Uri('https://php-spider.org'); |
||
33 | $uri3 = new Uri('#', $currentUri); |
||
34 | $uri4 = new Uri('mailto:[email protected]'); |
||
35 | |||
36 | $this->assertFalse($filter->match($uri), 'HTTP scheme filtered'); |
||
37 | $this->assertTrue($filter->match($uri2), 'HTTPS scheme filtered'); |
||
38 | $this->assertFalse($filter->match($uri3), 'empty/no scheme filtered'); |
||
39 | $this->assertTrue($filter->match($uri4), 'MAILTO scheme filtered'); |
||
40 | } |
||
42 |