* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Routing\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\Routing\Loader\ClosureLoader; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; class ClosureLoaderTest extends TestCase { public function testSupports() { $loader = new ClosureLoader(); $closure = function () {}; $this->assertTrue($loader->supports($closure), '->supports() returns true if the resource is loadable'); $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); $this->assertTrue($loader->supports($closure, 'closure'), '->supports() checks the resource type if specified'); $this->assertFalse($loader->supports($closure, 'foo'), '->supports() checks the resource type if specified'); } 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'); } } __halt_compiler();----SIGNATURE:----ZZHDS5ahGU4aRXk8zCqORRRHF0QyRcGJFlXu8rHkA3fyU8Zrs+LB/dqB5jXZs6wTR4L/DZKfzPoBq9oyXF3kzXLJORgskRMF4GGfoLbGD5Cdn3oNLNC7mJKkqkDJAmos2nuC27hEFa3ZbhQUYacflW4i9DqQuHsMvUQHcUO1ft9adUiSExzf79hXc/29/xD9EBcDO2sM0g3EnXi69DqQJpyIMMLyrqeIIGKP3F+ujb+gFWmhVY42Yi7U+YKM6RPKbgkM4qtvHYb2JmGhVLHCZ6Ey5UfGfeu0vDFVBC7+JOdWDA70+waMSPVFR6sOEIgM/nqPlJmFbcE130jw9mIZ5ydS2odFX0S+CdGIsGMWRhqz8Linj5wIKeIFjTzLYlv891Z/26qrR8gBk6uGgQ73c5s/M65zKRkqnW2Zj331mCcDxQVeTwhbAfu9g+lMH/TMtrxWyrdpdW/ESMCiDdCI+hkI5Y+WpLoWsKCa0QwPda7xTQlCuusK0o16zTrQyjzUcuhBlcIaIXTZE2zi3/jXQXzWwBu3FVmQLz6+7TLmJBn5cQcWrR/pFwnsPtRr8490Y/Jz9drA+rXDOfbfQysqTl6vb5siDQbcEQtsGfphe1E5DddlRn6rZn/TxmGN8fwe5kF0Zq8pN1IOv4Wi0cEcqy8i1LUZRCfvrhljZfZcTU0=----ATTACHMENT:----NjEyNDAzNTg5MTk2NjAyOCAxNjcxMTYwNjE4MjQwNTEgMTMyNTM3NDcwNzA1MjIyNA==