File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 55- Made the trace readable by exploding on the EOL character.
66- API filters are now applied before any other filters to ensure they are run first.
77- Request and response instances are correctly set on the formatter for exception responses.
8+ - Scopes set on groups are now parsed correctly.
89
910### v0.8.2
1011
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ protected function parseAction($action)
5050 return $ action ;
5151 }
5252
53+ /**
54+ * {@inheritDoc}
55+ */
56+ public function setAction (array $ action )
57+ {
58+ $ action = static ::parseAction ($ action );
59+
60+ return parent ::setAction ($ action );
61+ }
62+
5363 /**
5464 * Determine if the route is protected.
5565 *
Original file line number Diff line number Diff line change @@ -437,4 +437,22 @@ public function testRouterThrowsExceptionWhenInvalidAcceptHeaderWithStrict()
437437 $ this ->router ->setStrict (true );
438438 $ this ->router ->dispatch (Request::create ('foo ' , 'GET ' ));
439439 }
440+
441+ public function testRouterParsesScopesFromStringsToArrays ()
442+ {
443+ $ this ->router ->api (['version ' => 'v1 ' ], function () {
444+ $ this ->router ->group (['scopes ' => 'foo ' ], function () {
445+ $ this ->router ->get ('foo ' , function () {
446+ return 'bar ' ;
447+ });
448+ });
449+
450+ $ this ->router ->get ('bar ' , ['scopes ' => 'bar ' , function () {
451+ return 'baz ' ;
452+ }]);
453+ });
454+
455+ $ this ->assertEquals (['foo ' ], $ this ->router ->getApiGroups ()->getByVersion ('v1 ' )->getRoutes ()[0 ]->scopes ());
456+ $ this ->assertEquals (['bar ' ], $ this ->router ->getApiGroups ()->getByVersion ('v1 ' )->getRoutes ()[1 ]->scopes ());
457+ }
440458}
You can’t perform that action at this time.
0 commit comments