You are here

public function RouteTest::testMethod in Zircon Profile 8

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

File

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

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testMethod() {
  $route = new Route('/');
  $this
    ->assertEquals(array(), $route
    ->getMethods(), 'methods is initialized with array()');
  $route
    ->setMethods('gEt');
  $this
    ->assertEquals(array(
    'GET',
  ), $route
    ->getMethods(), '->setMethods() accepts a single method string and uppercases it');
  $route
    ->setMethods(array(
    'gEt',
    'PosT',
  ));
  $this
    ->assertEquals(array(
    'GET',
    'POST',
  ), $route
    ->getMethods(), '->setMethods() accepts an array of methods and uppercases them');
}