public function RouteCollectionTest::testRoute

File

drupal/core/vendor/symfony/routing/Symfony/Component/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');
}