@@ -74,5 +74,27 @@ public function testControllerOptionsMergeAndOverrideRouteOptions()
7474 $ this ->assertEquals (20 , $ route ->getRateExpiration (), 'Route did not setup rate limit expiration correctly. ' );
7575 $ this ->assertTrue ($ route ->hasThrottle (), 'Route did not setup throttle correctly. ' );
7676 $ this ->assertInstanceOf ('Dingo\Api\Tests\Stubs\BasicThrottleStub ' , $ route ->getThrottle (), 'Route did not setup throttle correctly. ' );
77+
78+ $ route = new Route ($ this ->adapter , $ this ->container , $ request , [
79+ 'uri ' => 'foo/bar ' ,
80+ 'methods ' => ['GET ' , 'HEAD ' ],
81+ 'action ' => [
82+ 'scopes ' => ['foo ' , 'bar ' ],
83+ 'providers ' => ['foo ' ],
84+ 'limit ' => 5 ,
85+ 'expires ' => 10 ,
86+ 'throttle ' => 'Foo ' ,
87+ 'version ' => ['v1 ' ],
88+ 'conditionalRequest ' => false ,
89+ 'uses ' => 'Dingo\Api\Tests\Stubs\RoutingControllerStub@show ' ,
90+ ],
91+ ]);
92+
93+ $ this ->assertEquals (['foo ' , 'bar ' , 'baz ' , 'bing ' , 'bob ' ], $ route ->scopes (), 'Route did not setup scopes correctly. ' );
94+ $ this ->assertEquals (['foo ' ], $ route ->getAuthProviders (), 'Route did not setup authentication providers correctly. ' );
95+ $ this ->assertEquals (10 , $ route ->getRateLimit (), 'Route did not setup rate limit correctly. ' );
96+ $ this ->assertEquals (20 , $ route ->getRateExpiration (), 'Route did not setup rate limit expiration correctly. ' );
97+ $ this ->assertTrue ($ route ->hasThrottle (), 'Route did not setup throttle correctly. ' );
98+ $ this ->assertInstanceOf ('Dingo\Api\Tests\Stubs\BasicThrottleStub ' , $ route ->getThrottle (), 'Route did not setup throttle correctly. ' );
7799 }
78100}
0 commit comments