You are here

public function RouteTest::testLegacyMethodRequirement in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Tests/RouteTest.php \Symfony\Component\Routing\Tests\RouteTest::testLegacyMethodRequirement()

@group legacy

File

vendor/symfony/routing/Tests/RouteTest.php, line 198

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testLegacyMethodRequirement() {
  $route = new Route('/');
  $route
    ->setRequirement('_method', 'GET|POST');
  $this
    ->assertEquals('GET|POST', $route
    ->getRequirement('_method'));
  $this
    ->assertEquals(array(
    'GET',
    'POST',
  ), $route
    ->getMethods());
  $route
    ->setMethods(array(
    'gEt',
  ));
  $this
    ->assertEquals('GET', $route
    ->getRequirement('_method'));
  $route
    ->setMethods(array());
  $this
    ->assertNull($route
    ->getRequirement('_method'));
}