You are here

public function RouteCollectionTest::testRoute 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::testRoute()

File

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

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testRoute() {
  $collection = new RouteCollection();
  $route = new Route('/foo');
  $collection
    ->add('foo', $route);
  $this
    ->assertEquals(array(
    'foo' => $route,
  ), $collection
    ->all(), '->add() adds a route');
  $this
    ->assertEquals($route, $collection
    ->get('foo'), '->get() returns a route by name');
  $this
    ->assertNull($collection
    ->get('bar'), '->get() returns null if a route does not exist');
}