public function RouteTest::testMethod

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php, line 162

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