public function RequestMatcherTest::testPath in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/RequestMatcherTest.php \Symfony\Component\HttpFoundation\Tests\RequestMatcherTest::testPath()
File
- vendor/
symfony/ http-foundation/ Tests/ RequestMatcherTest.php, line 94
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testPath() {
$matcher = new RequestMatcher();
$request = Request::create('/admin/foo');
$matcher
->matchPath('/admin/.*');
$this
->assertTrue($matcher
->matches($request));
$matcher
->matchPath('/admin');
$this
->assertTrue($matcher
->matches($request));
$matcher
->matchPath('^/admin/.*$');
$this
->assertTrue($matcher
->matches($request));
$matcher
->matchMethod('/blog/.*');
$this
->assertFalse($matcher
->matches($request));
}