@@ -45,6 +45,7 @@ protected function setUp(): void
4545 'getIsVirtual ' ,
4646 'getIsNotVirtual ' ,
4747 'getStatus ' ,
48+ 'getAllItems '
4849 ]
4950 )
5051 ->disableOriginalConstructor ()
@@ -104,6 +105,8 @@ public function testCheck(
104105 ->willReturn ($ isInProcess );
105106 $ this ->orderMock ->method ('getIsNotVirtual ' )
106107 ->willReturn ($ isNotVirtual );
108+ $ this ->orderMock ->method ('getAllItems ' )
109+ ->willReturn ([]);
107110 if (!$ isNotVirtual ) {
108111 $ this ->orderMock ->method ('getIsVirtual ' )
109112 ->willReturn (!$ isNotVirtual );
@@ -134,7 +137,8 @@ public function stateCheckDataProvider()
134137 'get_is_in_process_invoke_count ' => 0 ,
135138 'is_canceled ' => false ,
136139 'can_unhold ' => false ,
137- 'is_not_virtual ' => true
140+ 'is_not_virtual ' => true ,
141+ 'isPartiallyRefundedOrderShipped ' => false
138142 ],
139143 'complete - !canCreditmemo,!canShip -> closed ' => [
140144 'can_credit_memo ' => false ,
@@ -147,7 +151,8 @@ public function stateCheckDataProvider()
147151 'get_is_in_process_invoke_count ' => 0 ,
148152 'is_canceled ' => false ,
149153 'can_unhold ' => false ,
150- 'is_not_virtual ' => true
154+ 'is_not_virtual ' => true ,
155+ 'isPartiallyRefundedOrderShipped ' => false
151156 ],
152157 'processing - !canCreditmemo,canShip -> processing ' => [
153158 'can_credit_memo ' => false ,
@@ -160,7 +165,8 @@ public function stateCheckDataProvider()
160165 'get_is_in_process_invoke_count ' => 0 ,
161166 'is_canceled ' => false ,
162167 'can_unhold ' => false ,
163- 'is_not_virtual ' => true
168+ 'is_not_virtual ' => true ,
169+ 'isPartiallyRefundedOrderShipped ' => false
164170 ],
165171 'complete - !canCreditmemo,canShip -> complete ' => [
166172 'can_credit_memo ' => false ,
@@ -173,7 +179,8 @@ public function stateCheckDataProvider()
173179 'get_is_in_process_invoke_count ' => 0 ,
174180 'is_canceled ' => false ,
175181 'can_unhold ' => false ,
176- 'is_not_virtual ' => true
182+ 'is_not_virtual ' => true ,
183+ 'isPartiallyRefundedOrderShipped ' => false
177184 ],
178185 'processing - canCreditmemo,!canShip -> complete ' => [
179186 'can_credit_memo ' => true ,
@@ -186,7 +193,8 @@ public function stateCheckDataProvider()
186193 'get_is_in_process_invoke_count ' => 0 ,
187194 'is_canceled ' => false ,
188195 'can_unhold ' => false ,
189- 'is_not_virtual ' => true
196+ 'is_not_virtual ' => true ,
197+ 'isPartiallyRefundedOrderShipped ' => false
190198 ],
191199 'complete - canCreditmemo,!canShip -> complete ' => [
192200 'can_credit_memo ' => true ,
@@ -199,7 +207,8 @@ public function stateCheckDataProvider()
199207 'get_is_in_process_invoke_count ' => 0 ,
200208 'is_canceled ' => false ,
201209 'can_unhold ' => false ,
202- 'is_not_virtual ' => true
210+ 'is_not_virtual ' => true ,
211+ 'isPartiallyRefundedOrderShipped ' => false
203212 ],
204213 'processing - canCreditmemo, canShip -> processing ' => [
205214 'can_credit_memo ' => true ,
@@ -212,7 +221,8 @@ public function stateCheckDataProvider()
212221 'get_is_in_process_invoke_count ' => 0 ,
213222 'is_canceled ' => false ,
214223 'can_unhold ' => false ,
215- 'is_not_virtual ' => true
224+ 'is_not_virtual ' => true ,
225+ 'isPartiallyRefundedOrderShipped ' => false
216226 ],
217227 'complete - canCreditmemo, canShip -> complete ' => [
218228 'can_credit_memo ' => true ,
@@ -225,7 +235,8 @@ public function stateCheckDataProvider()
225235 'get_is_in_process_invoke_count ' => 0 ,
226236 'is_canceled ' => false ,
227237 'can_unhold ' => false ,
228- 'is_not_virtual ' => true
238+ 'is_not_virtual ' => true ,
239+ 'isPartiallyRefundedOrderShipped ' => false
229240 ],
230241 'new - canCreditmemo, canShip, IsInProcess -> processing ' => [
231242 'can_credit_memo ' => true ,
@@ -238,7 +249,8 @@ public function stateCheckDataProvider()
238249 'get_is_in_process_invoke_count ' => 1 ,
239250 'is_canceled ' => false ,
240251 'can_unhold ' => false ,
241- 'is_not_virtual ' => true
252+ 'is_not_virtual ' => true ,
253+ 'isPartiallyRefundedOrderShipped ' => false
242254 ],
243255 'new - canCreditmemo, !canShip, IsInProcess -> processing ' => [
244256 'can_credit_memo ' => true ,
@@ -251,7 +263,8 @@ public function stateCheckDataProvider()
251263 'get_is_in_process_invoke_count ' => 1 ,
252264 'is_canceled ' => false ,
253265 'can_unhold ' => false ,
254- 'is_not_virtual ' => true
266+ 'is_not_virtual ' => true ,
267+ 'isPartiallyRefundedOrderShipped ' => false
255268 ],
256269 'new - canCreditmemo, canShip, !IsInProcess -> new ' => [
257270 'can_credit_memo ' => true ,
@@ -264,7 +277,8 @@ public function stateCheckDataProvider()
264277 'get_is_in_process_invoke_count ' => 1 ,
265278 'is_canceled ' => false ,
266279 'can_unhold ' => false ,
267- 'is_not_virtual ' => true
280+ 'is_not_virtual ' => true ,
281+ 'isPartiallyRefundedOrderShipped ' => false
268282 ],
269283 'hold - canUnhold -> hold ' => [
270284 'can_credit_memo ' => true ,
@@ -277,7 +291,8 @@ public function stateCheckDataProvider()
277291 'get_is_in_process_invoke_count ' => 0 ,
278292 'is_canceled ' => false ,
279293 'can_unhold ' => true ,
280- 'is_not_virtual ' => true
294+ 'is_not_virtual ' => true ,
295+ 'isPartiallyRefundedOrderShipped ' => false
281296 ],
282297 'payment_review - canUnhold -> payment_review ' => [
283298 'can_credit_memo ' => true ,
@@ -290,7 +305,8 @@ public function stateCheckDataProvider()
290305 'get_is_in_process_invoke_count ' => 0 ,
291306 'is_canceled ' => false ,
292307 'can_unhold ' => true ,
293- 'is_not_virtual ' => true
308+ 'is_not_virtual ' => true ,
309+ 'isPartiallyRefundedOrderShipped ' => false
294310 ],
295311 'pending_payment - canUnhold -> pending_payment ' => [
296312 'can_credit_memo ' => true ,
@@ -303,7 +319,8 @@ public function stateCheckDataProvider()
303319 'get_is_in_process_invoke_count ' => 0 ,
304320 'is_canceled ' => false ,
305321 'can_unhold ' => true ,
306- 'is_not_virtual ' => true
322+ 'is_not_virtual ' => true ,
323+ 'isPartiallyRefundedOrderShipped ' => false
307324 ],
308325 'cancelled - isCanceled -> cancelled ' => [
309326 'can_credit_memo ' => true ,
@@ -316,7 +333,8 @@ public function stateCheckDataProvider()
316333 'get_is_in_process_invoke_count ' => 0 ,
317334 'is_canceled ' => true ,
318335 'can_unhold ' => false ,
319- 'is_not_virtual ' => true
336+ 'is_not_virtual ' => true ,
337+ 'isPartiallyRefundedOrderShipped ' => false
320338 ],
321339 'processing - !canCreditmemo!canShip -> complete(virtual product) ' => [
322340 'can_credit_memo ' => false ,
@@ -329,7 +347,8 @@ public function stateCheckDataProvider()
329347 'get_is_in_process_invoke_count ' => 0 ,
330348 'is_canceled ' => false ,
331349 'can_unhold ' => false ,
332- 'is_not_virtual ' => false
350+ 'is_not_virtual ' => false ,
351+ 'isPartiallyRefundedOrderShipped ' => false
333352 ],
334353 'complete - !canCreditmemo, !canShip - closed(virtual product) ' => [
335354 'can_credit_memo ' => false ,
@@ -343,6 +362,35 @@ public function stateCheckDataProvider()
343362 'is_canceled ' => false ,
344363 'can_unhold ' => false ,
345364 'is_not_virtual ' => false ,
365+ 'isPartiallyRefundedOrderShipped ' => false
366+ ],
367+ 'processing - canCreditmemo, !canShip, !isPartiallyRefundedOrderShipped -> processing ' => [
368+ 'can_credit_memo ' => true ,
369+ 'can_credit_memo_invoke_count ' => 1 ,
370+ 'can_ship ' => true ,
371+ 'call_can_skip_num ' => 1 ,
372+ 'current_state ' => Order::STATE_PROCESSING ,
373+ 'expected_state ' => Order::STATE_PROCESSING ,
374+ 'is_in_process ' => true ,
375+ 'get_is_in_process_invoke_count ' => 0 ,
376+ 'is_canceled ' => false ,
377+ 'can_unhold ' => false ,
378+ 'is_not_virtual ' => true ,
379+ 'isPartiallyRefundedOrderShipped ' => false
380+ ],
381+ 'processing - canCreditmemo, !canShip, isPartiallyRefundedOrderShipped -> complete ' => [
382+ 'can_credit_memo ' => true ,
383+ 'can_credit_memo_invoke_count ' => 1 ,
384+ 'can_ship ' => false ,
385+ 'call_can_skip_num ' => 1 ,
386+ 'current_state ' => Order::STATE_PROCESSING ,
387+ 'expected_state ' => Order::STATE_COMPLETE ,
388+ 'is_in_process ' => true ,
389+ 'get_is_in_process_invoke_count ' => 0 ,
390+ 'is_canceled ' => false ,
391+ 'can_unhold ' => false ,
392+ 'is_not_virtual ' => true ,
393+ 'isPartiallyRefundedOrderShipped ' => true
346394 ],
347395 ];
348396 }
0 commit comments