$this->
assertTrue($loader->
supports('foo.php', 'php'
), '->supports() checks the resource type if specified'
);
$this->
assertFalse($loader->
supports('foo.php', 'foo'
), '->supports() checks the resource type if specified'
);
} public function testLoadWithRoute() { $loader =
new PhpFileLoader(new FileLocator([__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->
assertTrue($route->
getDefault('_stateless'
));
$this->
assertSame('{locale}.example.com',
$route->
getHost());
$this->
assertSame('RouteCompiler',
$route->
getOption('compiler_class'
));
$this->
assertEquals(['GET', 'POST', 'PUT', 'OPTIONS'
],
$route->
getMethods());
$this->
assertEquals(['https'
],
$route->
getSchemes());
} }