You are here

public function RequestTest::testIsMethod in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::testIsMethod()

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 1410

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIsMethod() {
  $request = new Request();
  $request
    ->setMethod('POST');
  $this
    ->assertTrue($request
    ->isMethod('POST'));
  $this
    ->assertTrue($request
    ->isMethod('post'));
  $this
    ->assertFalse($request
    ->isMethod('GET'));
  $this
    ->assertFalse($request
    ->isMethod('get'));
  $request
    ->setMethod('GET');
  $this
    ->assertTrue($request
    ->isMethod('GET'));
  $this
    ->assertTrue($request
    ->isMethod('get'));
  $this
    ->assertFalse($request
    ->isMethod('POST'));
  $this
    ->assertFalse($request
    ->isMethod('post'));
}