You are here

public function RouteTest::testOptions 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::testOptions()

File

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

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testOptions() {
  $route = new Route('/{foo}');
  $route
    ->setOptions(array(
    'foo' => 'bar',
  ));
  $this
    ->assertEquals(array_merge(array(
    'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
  ), array(
    'foo' => 'bar',
  )), $route
    ->getOptions(), '->setOptions() sets the options');
  $this
    ->assertEquals($route, $route
    ->setOptions(array()), '->setOptions() implements a fluent interface');
  $route
    ->setOptions(array(
    'foo' => 'foo',
  ));
  $route
    ->addOptions(array(
    'bar' => 'bar',
  ));
  $this
    ->assertEquals($route, $route
    ->addOptions(array()), '->addOptions() implements a fluent interface');
  $this
    ->assertEquals(array(
    'foo' => 'foo',
    'bar' => 'bar',
    'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
  ), $route
    ->getOptions(), '->addDefaults() keep previous defaults');
}