@@ -104,14 +104,14 @@ protected function setUp()
104
104
$ this ->requestMock ->expects ($ this ->any ())->method ('getHttpHost ' )->willReturn ('testHostName.com ' );
105
105
$ this ->responseMock = $ this ->getResponseMock ();
106
106
$ routerMock = $ this ->getMockBuilder (\Magento \Webapi \Controller \Rest \Router::class)->setMethods (['match ' ])
107
- ->disableOriginalConstructor ()->getMock ();
107
+ ->disableOriginalConstructor ()->getMock ();
108
108
109
109
$ this ->routeMock = $ this ->getRouteMock ();
110
110
$ this ->serviceMock = $ this ->getMockBuilder (self ::SERVICE_ID )->setMethods ([self ::SERVICE_METHOD ])
111
- ->disableOriginalConstructor ()->getMock ();
111
+ ->disableOriginalConstructor ()->getMock ();
112
112
113
113
$ this ->oauthServiceMock = $ this ->getMockBuilder (\Magento \Framework \Oauth \OauthInterface::class)
114
- ->setMethods (['validateAccessTokenRequest ' ])->getMockForAbstractClass ();
114
+ ->setMethods (['validateAccessTokenRequest ' ])->getMockForAbstractClass ();
115
115
$ this ->authorizationMock = $ this ->getMockBuilder (\Magento \Framework \Webapi \Authorization::class)
116
116
->disableOriginalConstructor ()->getMock ();
117
117
@@ -125,7 +125,7 @@ protected function setUp()
125
125
->getMockForAbstractClass ();
126
126
127
127
$ layoutMock = $ this ->getMockBuilder (\Magento \Framework \View \LayoutInterface::class)
128
- ->disableOriginalConstructor ()->getMock ();
128
+ ->disableOriginalConstructor ()->getMock ();
129
129
130
130
$ errorProcessorMock = $ this ->createMock (\Magento \Framework \Webapi \ErrorProcessor::class);
131
131
$ errorProcessorMock ->expects ($ this ->any ())->method ('maskException ' )->will ($ this ->returnArgument (0 ));
@@ -166,14 +166,14 @@ protected function setUp()
166
166
167
167
$ this ->routeMock ->expects ($ this ->any ())->method ('getServiceClass ' )->will ($ this ->returnValue (self ::SERVICE_ID ));
168
168
$ this ->routeMock ->expects ($ this ->any ())->method ('getServiceMethod ' )
169
- ->will ($ this ->returnValue (self ::SERVICE_METHOD ));
169
+ ->will ($ this ->returnValue (self ::SERVICE_METHOD ));
170
170
171
171
$ routerMock ->expects ($ this ->any ())->method ('match ' )->will ($ this ->returnValue ($ this ->routeMock ));
172
172
173
173
$ objectManagerMock ->expects ($ this ->any ())->method ('get ' )->will ($ this ->returnValue ($ this ->serviceMock ));
174
174
$ this ->responseMock ->expects ($ this ->any ())->method ('prepareResponse ' )->will ($ this ->returnValue ([]));
175
175
$ this ->serviceMock ->expects ($ this ->any ())->method (self ::SERVICE_METHOD )->will ($ this ->returnValue (null ));
176
-
176
+
177
177
$ dataObjectProcessorMock ->expects ($ this ->any ())->method ('getMethodReturnType ' )
178
178
->with (self ::SERVICE_ID , self ::SERVICE_METHOD )
179
179
->will ($ this ->returnValue ('null ' ));
@@ -189,12 +189,12 @@ public function testDispatchSchemaRequest()
189
189
\Magento \Framework \Webapi \Request::REQUEST_PARAM_SERVICES => 'foo ' ,
190
190
];
191
191
$ this ->requestMock ->expects ($ this ->any ())
192
- ->method ('getPathInfo ' )
193
- ->willReturn (AsynchronousSchemaRequestProcessor::PROCESSOR_PATH );
192
+ ->method ('getPathInfo ' )
193
+ ->willReturn (AsynchronousSchemaRequestProcessor::PROCESSOR_PATH );
194
194
195
195
$ this ->requestMock ->expects ($ this ->any ())
196
- ->method ('getParams ' )
197
- ->will ($ this ->returnValue ($ params ));
196
+ ->method ('getParams ' )
197
+ ->will ($ this ->returnValue ($ params ));
198
198
199
199
$ schema = 'Some REST schema content ' ;
200
200
$ this ->swaggerGeneratorMock ->expects ($ this ->any ())->method ('generate ' )->willReturn ($ schema );
@@ -209,25 +209,25 @@ public function testDispatchAllSchemaRequest()
209
209
\Magento \Framework \Webapi \Request::REQUEST_PARAM_SERVICES => 'all ' ,
210
210
];
211
211
$ this ->requestMock ->expects ($ this ->any ())
212
- ->method ('getPathInfo ' )
213
- ->willReturn (AsynchronousSchemaRequestProcessor::PROCESSOR_PATH );
212
+ ->method ('getPathInfo ' )
213
+ ->willReturn (AsynchronousSchemaRequestProcessor::PROCESSOR_PATH );
214
214
$ this ->requestMock ->expects ($ this ->any ())
215
- ->method ('getParam ' )
216
- ->will (
217
- $ this ->returnValueMap ([
218
- [
219
- \Magento \Framework \Webapi \Request::REQUEST_PARAM_SERVICES ,
220
- null ,
221
- 'all ' ,
222
- ],
223
- ])
224
- );
215
+ ->method ('getParam ' )
216
+ ->will (
217
+ $ this ->returnValueMap ([
218
+ [
219
+ \Magento \Framework \Webapi \Request::REQUEST_PARAM_SERVICES ,
220
+ null ,
221
+ 'all ' ,
222
+ ],
223
+ ])
224
+ );
225
225
$ this ->requestMock ->expects ($ this ->any ())
226
- ->method ('getParams ' )
227
- ->will ($ this ->returnValue ($ params ));
226
+ ->method ('getParams ' )
227
+ ->will ($ this ->returnValue ($ params ));
228
228
$ this ->requestMock ->expects ($ this ->any ())
229
- ->method ('getRequestedServices ' )
230
- ->will ($ this ->returnValue ('all ' ));
229
+ ->method ('getRequestedServices ' )
230
+ ->will ($ this ->returnValue ('all ' ));
231
231
232
232
$ schema = 'Some REST schema content ' ;
233
233
$ this ->swaggerGeneratorMock ->expects ($ this ->any ())->method ('generate ' )->willReturn ($ schema );
@@ -244,9 +244,9 @@ private function getRequestProccessotPoolMock()
244
244
$ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
245
245
246
246
$ this ->swaggerGeneratorMock = $ this ->getMockBuilder (\Magento \Webapi \Model \Rest \Swagger \Generator::class)
247
- ->disableOriginalConstructor ()
248
- ->setMethods (['generate ' , 'getListOfServices ' ])
249
- ->getMockForAbstractClass ();
247
+ ->disableOriginalConstructor ()
248
+ ->setMethods (['generate ' , 'getListOfServices ' ])
249
+ ->getMockForAbstractClass ();
250
250
251
251
$ this ->asyncSchemaRequestProcessor = $ objectManager ->getObject (
252
252
\Magento \WebapiAsync \Controller \Rest \AsynchronousSchemaRequestProcessor::class,
@@ -258,9 +258,9 @@ private function getRequestProccessotPoolMock()
258
258
259
259
$ this ->asyncRequestProcessor =
260
260
$ this ->getMockBuilder (\Magento \WebapiAsync \Controller \Rest \AsynchronousRequestProcessor::class)
261
- ->setMethods (['process ' ])
262
- ->disableOriginalConstructor ()
263
- ->getMock ();
261
+ ->setMethods (['process ' ])
262
+ ->disableOriginalConstructor ()
263
+ ->getMock ();
264
264
265
265
return $ objectManager ->getObject (
266
266
\Magento \Webapi \Controller \Rest \RequestProcessorPool::class,
@@ -279,14 +279,14 @@ private function getRequestProccessotPoolMock()
279
279
private function getRouteMock ()
280
280
{
281
281
return $ this ->getMockBuilder (\Magento \Webapi \Controller \Rest \Router \Route::class)
282
- ->setMethods ([
283
- 'isSecure ' ,
284
- 'getServiceMethod ' ,
285
- 'getServiceClass ' ,
286
- 'getAclResources ' ,
287
- 'getParameters ' ,
288
- ])
289
- ->disableOriginalConstructor ()->getMock ();
282
+ ->setMethods ([
283
+ 'isSecure ' ,
284
+ 'getServiceMethod ' ,
285
+ 'getServiceClass ' ,
286
+ 'getAclResources ' ,
287
+ 'getParameters ' ,
288
+ ])
289
+ ->disableOriginalConstructor ()->getMock ();
290
290
}
291
291
292
292
/**
@@ -295,18 +295,18 @@ private function getRouteMock()
295
295
private function getRequestMock ()
296
296
{
297
297
return $ this ->getMockBuilder (\Magento \Framework \Webapi \Rest \Request::class)
298
- ->setMethods (
299
- [
300
- 'isSecure ' ,
301
- 'getRequestData ' ,
302
- 'getParams ' ,
303
- 'getParam ' ,
304
- 'getRequestedServices ' ,
305
- 'getPathInfo ' ,
306
- 'getHttpHost ' ,
307
- 'getMethod ' ,
308
- ]
309
- )->disableOriginalConstructor ()->getMock ();
298
+ ->setMethods (
299
+ [
300
+ 'isSecure ' ,
301
+ 'getRequestData ' ,
302
+ 'getParams ' ,
303
+ 'getParam ' ,
304
+ 'getRequestedServices ' ,
305
+ 'getPathInfo ' ,
306
+ 'getHttpHost ' ,
307
+ 'getMethod ' ,
308
+ ]
309
+ )->disableOriginalConstructor ()->getMock ();
310
310
}
311
311
312
312
/**
@@ -315,8 +315,8 @@ private function getRequestMock()
315
315
private function getResponseMock ()
316
316
{
317
317
return $ this ->getMockBuilder (\Magento \Framework \Webapi \Rest \Response::class)
318
- ->setMethods (['sendResponse ' , 'prepareResponse ' , 'setHeader ' ])
319
- ->disableOriginalConstructor ()
320
- ->getMock ();
318
+ ->setMethods (['sendResponse ' , 'prepareResponse ' , 'setHeader ' ])
319
+ ->disableOriginalConstructor ()
320
+ ->getMock ();
321
321
}
322
322
}
0 commit comments