public function setUp() { // Simulates Route parameters. $request = Request::create('/admin/things', 'GET'); $request->setRouteResolver(function () use($request) { $route = new Route('GET', '/admin/things', []); $route->bind($request); return $route; }); $this->controller = $this->getMockForAbstractClass(CrudController::class, [$request]); }
/** * Transform route into string route identity * * @param Illuminate\Routing\Route $route * @return string formatted '<route_methods> <route_regex>' */ protected function getRouteIdentity(Route $route) { $route->bind($this->app['request']); $regex = $route->getCompiled()->getRegex(); $methods = implode('|', $route->getMethods()); return $methods . ' ' . $regex; }