public function PhpFileLoaderTest::testLoadWithRoute in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/Loader/PhpFileLoaderTest.php \Symfony\Component\Routing\Tests\Loader\PhpFileLoaderTest::testLoadWithRoute()
File
- vendor/
symfony/ routing/ Tests/ Loader/ PhpFileLoaderTest.php, line 30
Class
Namespace
Symfony\Component\Routing\Tests\LoaderCode
public function testLoadWithRoute() {
$loader = new PhpFileLoader(new FileLocator(array(
__DIR__ . '/../Fixtures',
)));
$routeCollection = $loader
->load('validpattern.php');
$routes = $routeCollection
->all();
$this
->assertCount(1, $routes, 'One route is loaded');
$this
->assertContainsOnly('Symfony\\Component\\Routing\\Route', $routes);
foreach ($routes as $route) {
$this
->assertSame('/blog/{slug}', $route
->getPath());
$this
->assertSame('MyBlogBundle:Blog:show', $route
->getDefault('_controller'));
$this
->assertSame('{locale}.example.com', $route
->getHost());
$this
->assertSame('RouteCompiler', $route
->getOption('compiler_class'));
$this
->assertEquals(array(
'GET',
'POST',
'PUT',
'OPTIONS',
), $route
->getMethods());
$this
->assertEquals(array(
'https',
), $route
->getSchemes());
}
}