@@ -20,41 +20,27 @@ public function getAdapterInstance()
2020
2121 public function testRouteOptionsMergeCorrectly ()
2222 {
23- $ this ->router ->version ('v1 ' , ['protected ' => true , ' scopes ' => 'foo|bar ' ], function () {
23+ $ this ->router ->version ('v1 ' , ['scopes ' => 'foo|bar ' ], function () {
2424 $ this ->router ->get ('foo ' , ['scopes ' => ['baz ' ], function () {
25- $ this ->assertTrue (
26- $ this ->router ->getCurrentRoute ()->isProtected (),
27- 'Route was not protected but should be. '
28- );
2925 $ this ->assertEquals (
3026 ['foo ' , 'bar ' , 'baz ' ],
3127 $ this ->router ->getCurrentRoute ()->getScopes (),
3228 'Router did not merge string based group scopes with route based array scopes. '
3329 );
3430 }]);
3531
36- $ this ->router ->get ('bar ' , ['protected ' => false , function () {
37- $ this ->assertFalse (
38- $ this ->router ->getCurrentRoute ()->isProtected (),
39- 'Route was protected but should not be. '
40- );
41- }]);
42-
43- $ this ->router ->get ('baz ' , ['protected ' => false , function () {
32+ $ this ->router ->get ('baz ' , function () {
4433 $ this ->assertEquals (
4534 ['foo ' , 'bar ' ],
4635 $ this ->router ->getCurrentRoute ()->getScopes (),
4736 'Router did not merge string based group scopes with route. '
4837 );
49- }] );
38+ });
5039 });
5140
5241 $ request = $ this ->createRequest ('foo ' , 'GET ' , ['accept ' => 'application/vnd.api.v1+json ' ]);
5342 $ this ->router ->dispatch ($ request );
5443
55- $ request = $ this ->createRequest ('bar ' , 'GET ' , ['accept ' => 'application/vnd.api.v1+json ' ]);
56- $ this ->router ->dispatch ($ request );
57-
5844 $ request = $ this ->createRequest ('baz ' , 'GET ' , ['accept ' => 'application/vnd.api.v1+json ' ]);
5945 $ this ->router ->dispatch ($ request );
6046
@@ -69,7 +55,6 @@ public function testRouteOptionsMergeCorrectly()
6955
7056 $ this ->assertEquals (['baz ' , 'bing ' ], $ route ->scopes ());
7157 $ this ->assertEquals (['foo ' , 'red ' , 'black ' ], $ route ->getAuthProviders ());
72- $ this ->assertTrue ($ route ->isProtected ());
7358 $ this ->assertEquals (10 , $ route ->getRateLimit ());
7459 $ this ->assertEquals (20 , $ route ->getRateExpiration ());
7560 $ this ->assertEquals ('Zippy ' , $ route ->getThrottle ());
@@ -239,23 +224,6 @@ public function testUnsuccessfulResponseThrowsHttpException()
239224 $ this ->assertEquals ('Failed! ' , $ this ->router ->dispatch ($ request )->getContent (), 'Router did not throw and handle a HttpException. ' );
240225 }
241226
242- public function testRouteMiddlewaresAreUnsetAndMovedIfManuallySetOnRoutes ()
243- {
244- $ this ->router ->version ('v1 ' , function () {
245- $ this ->router ->get ('foo ' , ['middleware ' => 'foo|api.auth ' , function () use (&$ middleware ) {
246- $ route = $ this ->router ->getCurrentRoute ();
247-
248- $ this ->assertEquals (['api.auth ' , 'api.limiting ' , 'foo ' ], $ route ->getAction ()['middleware ' ]);
249-
250- return 'foo ' ;
251- }]);
252- });
253-
254- $ request = $ this ->createRequest ('foo ' , 'GET ' );
255-
256- $ this ->router ->dispatch ($ request );
257- }
258-
259227 public function testGroupNamespacesAreConcatenated ()
260228 {
261229 $ this ->router ->version ('v1 ' , ['namespace ' => 'Dingo\Api ' ], function () {
0 commit comments