public function RequestMatcherTest::testMethod

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php, line 91

Class

RequestMatcherTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testMethod() {
  $matcher = new RequestMatcher();
  $matcher
    ->matchMethod('get');
  $request = Request::create('', 'get');
  $this
    ->assertTrue($matcher
    ->matches($request));
  $matcher
    ->matchMethod('post');
  $this
    ->assertFalse($matcher
    ->matches($request));
  $matcher
    ->matchMethod(array(
    'get',
    'post',
  ));
  $this
    ->assertTrue($matcher
    ->matches($request));
}