You are here

public function RequestMatcherTest::testPath in Zircon Profile 8

Same name and namespace in other branches
  1. 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

RequestMatcherTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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));
}