You are here

public function ClosureLoaderTest::testLoad in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php \Symfony\Component\Routing\Tests\Loader\ClosureLoaderTest::testLoad()
  2. 8 vendor/symfony/dependency-injection/Tests/Loader/ClosureLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\ClosureLoaderTest::testLoad()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php \Symfony\Component\Routing\Tests\Loader\ClosureLoaderTest::testLoad()

File

vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php, line 33

Class

ClosureLoaderTest

Namespace

Symfony\Component\Routing\Tests\Loader

Code

public function testLoad() {
  $loader = new ClosureLoader();
  $route = new Route('/');
  $routes = $loader
    ->load(function () use ($route) {
    $routes = new RouteCollection();
    $routes
      ->add('foo', $route);
    return $routes;
  });
  $this
    ->assertEquals($route, $routes
    ->get('foo'), '->load() loads a \\Closure resource');
}