Closed niveshsaharan closed 4 years ago
Nice. But what is onlyThese
? How is it used?
$onlyThese checks if the route has only the expected middlewares. For example, I want to check if route 'home' uses only 'web' and 'auth' middlewares and nothing else:
$this->assertRouteUsesMiddleware('home', ['web', 'auth'], true);
The test will fail if the route has any other middleware than these 2.
I see. Could you rename to only
, exact
, or strict
. Your choice.
Also, could you ensure you code mets the project coding standard (PSR-2).
Added a handy method to check if a route uses given set of middlewares and option to check if it uses only the given set of middlewares.
I needed this to use in one of my application so I thought I'd create a pull request and maybe other people can find it useful.