@@ -42,7 +42,7 @@ class AuthorizationMiddlewareTest extends TestCase
4242{
4343 public function testInvokeService ()
4444 {
45- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
45+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
4646 $ request = new ServerRequest ();
4747 $ handler = new TestRequestHandler (function ($ request ) use ($ service ) {
4848 $ this ->assertInstanceOf (ServerRequestInterface::class, $ request );
@@ -80,7 +80,7 @@ public function testInvokeAuthorizationRequiredError()
8080
8181 public function testInvokeApp ()
8282 {
83- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
83+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
8484 $ provider = $ this ->createMock (AuthorizationServiceProviderInterface::class);
8585 $ provider
8686 ->expects ($ this ->once ())
@@ -110,7 +110,7 @@ public function testInvokeServiceWithIdentity()
110110 'id ' => 1 ,
111111 ]);
112112
113- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
113+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
114114 $ request = (new ServerRequest ())->withAttribute ('identity ' , $ identity );
115115 $ handler = new TestRequestHandler (function ($ request ) use ($ service ) {
116116 $ this ->assertInstanceOf (RequestInterface::class, $ request );
@@ -130,7 +130,7 @@ public function testInvokeServiceWithIdentity()
130130
131131 public function testIdentityInstance ()
132132 {
133- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
133+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
134134 $ identity = new IdentityDecorator ($ service , [
135135 'id ' => 1 ,
136136 ]);
@@ -155,7 +155,7 @@ public function testCustomIdentity()
155155 'id ' => 1 ,
156156 ];
157157
158- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
158+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
159159 $ request = (new ServerRequest ())->withAttribute ('user ' , $ identity );
160160 $ handler = new TestRequestHandler (function ($ request ) use ($ service ) {
161161 $ this ->assertInstanceOf (RequestInterface::class, $ request );
@@ -183,7 +183,7 @@ public function testCustomIdentityDecorator()
183183 'id ' => 1 ,
184184 ]);
185185
186- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
186+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
187187 $ request = (new ServerRequest ())->withAttribute ('identity ' , $ identity );
188188 $ handler = new TestRequestHandler (function ($ request ) use ($ service , $ identity ) {
189189 $ this ->assertInstanceOf (RequestInterface::class, $ request );
@@ -212,7 +212,7 @@ public function testInvalidIdentity()
212212 'id ' => 1 ,
213213 ];
214214
215- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
215+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
216216 $ request = (new ServerRequest ())->withAttribute ('identity ' , $ identity );
217217 $ handler = new TestRequestHandler ();
218218
@@ -229,7 +229,7 @@ public function testInvalidIdentity()
229229
230230 public function testUnauthorizedHandler ()
231231 {
232- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
232+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
233233 $ request = new ServerRequest ();
234234 $ handler = new TestRequestHandler (function () {
235235 throw new Exception ();
@@ -243,7 +243,7 @@ public function testUnauthorizedHandler()
243243
244244 public function testUnauthorizedHandlerSuppress ()
245245 {
246- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
246+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
247247 $ request = new ServerRequest ();
248248 $ handler = new TestRequestHandler (function () {
249249 throw new Exception ();
@@ -260,7 +260,7 @@ public function testUnauthorizedHandlerSuppress()
260260
261261 public function testUnauthorizedHandlerRequireAuthz ()
262262 {
263- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
263+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
264264 $ request = new ServerRequest ();
265265 $ handler = new TestRequestHandler (function () {
266266 throw new Exception ();
@@ -301,7 +301,7 @@ public function testMiddlewareInjectsServiceIntoDICViaCustomContainerInstance()
301301 );
302302 $ handler = new TestRequestHandler ();
303303
304- $ service = $ this ->createMock (AuthorizationServiceInterface::class);
304+ $ service = $ this ->createStub (AuthorizationServiceInterface::class);
305305 $ provider = $ this ->createMock (AuthorizationServiceProviderInterface::class);
306306 $ provider
307307 ->expects ($ this ->once ())
0 commit comments