@@ -102,10 +102,10 @@ public function testWrappedKernelIsHandledWhenRateLimitHasNotBeenExceeded()
102102 $ ip = $ request ->getClientIp ();
103103
104104 $ cache ->shouldReceive ('add ' )->once ()->with ('dingo:api:limit: ' .$ ip , 0 , 1 );
105- $ cache ->shouldReceive ('add ' )->once ()-> with ( ' dingo:api:reset: ' . $ ip , time () + 60 , 1 ) ;
105+ $ cache ->shouldReceive ('add ' )->once ();
106106 $ cache ->shouldReceive ('increment ' )->once ()->with ('dingo:api:limit: ' .$ ip );
107107 $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:limit: ' .$ ip )->andReturn (1 );
108- $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:reset: ' .$ ip )-> andReturn ( time () + 60 ) ;
108+ $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:reset: ' .$ ip );
109109
110110 $ app ->shouldReceive ('handle ' )->once ()->with ($ request , HttpKernelInterface::MASTER_REQUEST , true )->andReturn ($ response );
111111 $ response = $ middleware ->handle ($ request );
@@ -137,10 +137,10 @@ public function testForbiddenResponseIsReturnedWhenRateLimitIsExceeded()
137137 $ ip = $ request ->getClientIp ();
138138
139139 $ cache ->shouldReceive ('add ' )->once ()->with ('dingo:api:limit: ' .$ ip , 0 , 1 );
140- $ cache ->shouldReceive ('add ' )->once ()-> with ( ' dingo:api:reset: ' . $ ip , time () + 60 , 1 ) ;
140+ $ cache ->shouldReceive ('add ' )->once ();
141141 $ cache ->shouldReceive ('increment ' )->once ()->with ('dingo:api:limit: ' .$ ip );
142142 $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:limit: ' .$ ip )->andReturn (2 );
143- $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:reset: ' .$ ip )-> andReturn ( time () + 60 ) ;
143+ $ cache ->shouldReceive ('get ' )->once ()->with ('dingo:api:reset: ' .$ ip );
144144
145145 $ response = $ middleware ->handle ($ request );
146146 $ this ->assertEquals (1 , $ response ->headers ->get ('X-RateLimit-Limit ' ));
0 commit comments