1 | <?php |
||
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 | } |