Completed
Push — master ( d752b0...a10eb8 )
by
unknown
04:31
created

PathRegexUrlMatcherTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3
1
<?php
2
3
namespace tests\MediaMonks\Crawler\Url\Matcher;
4
5
use MediaMonks\Crawler\Url;
6
use MediaMonks\Crawler\Url\Matcher\PathRegexUrlMatcher;
7
use Mockery as m;
8
9
class PathRegexUrlMatcherTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function test_matches_path_regex()
12
    {
13
        $callbackUrlMatcher = new PathRegexUrlMatcher('~^/foo~');
14
15
        $this->assertTrue($callbackUrlMatcher->matches(Url::createFromString('http://my-project/foo')));
16
        $this->assertTrue($callbackUrlMatcher->matches(Url::createFromString('http://my-project/foo/bat')));
17
        $this->assertFalse($callbackUrlMatcher->matches(Url::createFromString('http://my-project/bar')));
18
        $this->assertFalse($callbackUrlMatcher->matches(Url::createFromString('http://my-project/bar/foo')));
19
    }
20
}