You are here

public function RouteCollectionTest::testSetCondition in Zircon Profile 8

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

File

vendor/symfony/routing/Tests/RouteCollectionTest.php, line 248

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testSetCondition() {
  $collection = new RouteCollection();
  $routea = new Route('/a');
  $routeb = new Route('/b', array(), array(), array(), '{locale}.example.net', array(), array(), 'context.getMethod() == "GET"');
  $collection
    ->add('a', $routea);
  $collection
    ->add('b', $routeb);
  $collection
    ->setCondition('context.getMethod() == "POST"');
  $this
    ->assertEquals('context.getMethod() == "POST"', $routea
    ->getCondition());
  $this
    ->assertEquals('context.getMethod() == "POST"', $routeb
    ->getCondition());
}