MockRouteProvider
class MockRouteProvider implements RouteProviderInterface (View source)
Easily configurable mock route provider.
Properties
| protected RouteCollection | $routes | A collection of routes for this route provider. |
Methods
Constructs a new MockRouteProvider.
Implements \Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteCollectionForRequest().
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Get all routes which match a certain pattern.
Returns all the routes on the system.
Resets the route provider object.
Details
__construct(RouteCollection $routes)
Constructs a new MockRouteProvider.
getRouteCollectionForRequest(Request $request)
Implements \Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteCollectionForRequest().
Simply return all routes to prevent \Symfony\Component\Routing\Exception\ResourceNotFoundException.
getRouteByName($name)
{@inheritdoc}
preLoadRoutes($names)
{@inheritdoc}
getRoutesByNames($names)
{@inheritdoc}
RouteCollection
getRoutesByPattern(string $pattern)
Get all routes which match a certain pattern.
Route[]
getAllRoutes()
Returns all the routes on the system.
Usage of this method is discouraged for performance reasons. If possible, use RouteProviderInterface::getRoutesByNames() or RouteProviderInterface::getRoutesByPattern() instead.
reset()
Resets the route provider object.