@@ -45,6 +45,7 @@ protected function setUp(): void
45
45
'getIsVirtual ' ,
46
46
'getIsNotVirtual ' ,
47
47
'getStatus ' ,
48
+ 'getAllItems '
48
49
]
49
50
)
50
51
->disableOriginalConstructor ()
@@ -104,6 +105,8 @@ public function testCheck(
104
105
->willReturn ($ isInProcess );
105
106
$ this ->orderMock ->method ('getIsNotVirtual ' )
106
107
->willReturn ($ isNotVirtual );
108
+ $ this ->orderMock ->method ('getAllItems ' )
109
+ ->willReturn ([]);
107
110
if (!$ isNotVirtual ) {
108
111
$ this ->orderMock ->method ('getIsVirtual ' )
109
112
->willReturn (!$ isNotVirtual );
@@ -134,7 +137,8 @@ public function stateCheckDataProvider()
134
137
'get_is_in_process_invoke_count ' => 0 ,
135
138
'is_canceled ' => false ,
136
139
'can_unhold ' => false ,
137
- 'is_not_virtual ' => true
140
+ 'is_not_virtual ' => true ,
141
+ 'isPartiallyRefundedOrderShipped ' => false
138
142
],
139
143
'complete - !canCreditmemo,!canShip -> closed ' => [
140
144
'can_credit_memo ' => false ,
@@ -147,7 +151,8 @@ public function stateCheckDataProvider()
147
151
'get_is_in_process_invoke_count ' => 0 ,
148
152
'is_canceled ' => false ,
149
153
'can_unhold ' => false ,
150
- 'is_not_virtual ' => true
154
+ 'is_not_virtual ' => true ,
155
+ 'isPartiallyRefundedOrderShipped ' => false
151
156
],
152
157
'processing - !canCreditmemo,canShip -> processing ' => [
153
158
'can_credit_memo ' => false ,
@@ -160,7 +165,8 @@ public function stateCheckDataProvider()
160
165
'get_is_in_process_invoke_count ' => 0 ,
161
166
'is_canceled ' => false ,
162
167
'can_unhold ' => false ,
163
- 'is_not_virtual ' => true
168
+ 'is_not_virtual ' => true ,
169
+ 'isPartiallyRefundedOrderShipped ' => false
164
170
],
165
171
'complete - !canCreditmemo,canShip -> complete ' => [
166
172
'can_credit_memo ' => false ,
@@ -173,7 +179,8 @@ public function stateCheckDataProvider()
173
179
'get_is_in_process_invoke_count ' => 0 ,
174
180
'is_canceled ' => false ,
175
181
'can_unhold ' => false ,
176
- 'is_not_virtual ' => true
182
+ 'is_not_virtual ' => true ,
183
+ 'isPartiallyRefundedOrderShipped ' => false
177
184
],
178
185
'processing - canCreditmemo,!canShip -> complete ' => [
179
186
'can_credit_memo ' => true ,
@@ -186,7 +193,8 @@ public function stateCheckDataProvider()
186
193
'get_is_in_process_invoke_count ' => 0 ,
187
194
'is_canceled ' => false ,
188
195
'can_unhold ' => false ,
189
- 'is_not_virtual ' => true
196
+ 'is_not_virtual ' => true ,
197
+ 'isPartiallyRefundedOrderShipped ' => false
190
198
],
191
199
'complete - canCreditmemo,!canShip -> complete ' => [
192
200
'can_credit_memo ' => true ,
@@ -199,7 +207,8 @@ public function stateCheckDataProvider()
199
207
'get_is_in_process_invoke_count ' => 0 ,
200
208
'is_canceled ' => false ,
201
209
'can_unhold ' => false ,
202
- 'is_not_virtual ' => true
210
+ 'is_not_virtual ' => true ,
211
+ 'isPartiallyRefundedOrderShipped ' => false
203
212
],
204
213
'processing - canCreditmemo, canShip -> processing ' => [
205
214
'can_credit_memo ' => true ,
@@ -212,7 +221,8 @@ public function stateCheckDataProvider()
212
221
'get_is_in_process_invoke_count ' => 0 ,
213
222
'is_canceled ' => false ,
214
223
'can_unhold ' => false ,
215
- 'is_not_virtual ' => true
224
+ 'is_not_virtual ' => true ,
225
+ 'isPartiallyRefundedOrderShipped ' => false
216
226
],
217
227
'complete - canCreditmemo, canShip -> complete ' => [
218
228
'can_credit_memo ' => true ,
@@ -225,7 +235,8 @@ public function stateCheckDataProvider()
225
235
'get_is_in_process_invoke_count ' => 0 ,
226
236
'is_canceled ' => false ,
227
237
'can_unhold ' => false ,
228
- 'is_not_virtual ' => true
238
+ 'is_not_virtual ' => true ,
239
+ 'isPartiallyRefundedOrderShipped ' => false
229
240
],
230
241
'new - canCreditmemo, canShip, IsInProcess -> processing ' => [
231
242
'can_credit_memo ' => true ,
@@ -238,7 +249,8 @@ public function stateCheckDataProvider()
238
249
'get_is_in_process_invoke_count ' => 1 ,
239
250
'is_canceled ' => false ,
240
251
'can_unhold ' => false ,
241
- 'is_not_virtual ' => true
252
+ 'is_not_virtual ' => true ,
253
+ 'isPartiallyRefundedOrderShipped ' => false
242
254
],
243
255
'new - canCreditmemo, !canShip, IsInProcess -> processing ' => [
244
256
'can_credit_memo ' => true ,
@@ -251,7 +263,8 @@ public function stateCheckDataProvider()
251
263
'get_is_in_process_invoke_count ' => 1 ,
252
264
'is_canceled ' => false ,
253
265
'can_unhold ' => false ,
254
- 'is_not_virtual ' => true
266
+ 'is_not_virtual ' => true ,
267
+ 'isPartiallyRefundedOrderShipped ' => false
255
268
],
256
269
'new - canCreditmemo, canShip, !IsInProcess -> new ' => [
257
270
'can_credit_memo ' => true ,
@@ -264,7 +277,8 @@ public function stateCheckDataProvider()
264
277
'get_is_in_process_invoke_count ' => 1 ,
265
278
'is_canceled ' => false ,
266
279
'can_unhold ' => false ,
267
- 'is_not_virtual ' => true
280
+ 'is_not_virtual ' => true ,
281
+ 'isPartiallyRefundedOrderShipped ' => false
268
282
],
269
283
'hold - canUnhold -> hold ' => [
270
284
'can_credit_memo ' => true ,
@@ -277,7 +291,8 @@ public function stateCheckDataProvider()
277
291
'get_is_in_process_invoke_count ' => 0 ,
278
292
'is_canceled ' => false ,
279
293
'can_unhold ' => true ,
280
- 'is_not_virtual ' => true
294
+ 'is_not_virtual ' => true ,
295
+ 'isPartiallyRefundedOrderShipped ' => false
281
296
],
282
297
'payment_review - canUnhold -> payment_review ' => [
283
298
'can_credit_memo ' => true ,
@@ -290,7 +305,8 @@ public function stateCheckDataProvider()
290
305
'get_is_in_process_invoke_count ' => 0 ,
291
306
'is_canceled ' => false ,
292
307
'can_unhold ' => true ,
293
- 'is_not_virtual ' => true
308
+ 'is_not_virtual ' => true ,
309
+ 'isPartiallyRefundedOrderShipped ' => false
294
310
],
295
311
'pending_payment - canUnhold -> pending_payment ' => [
296
312
'can_credit_memo ' => true ,
@@ -303,7 +319,8 @@ public function stateCheckDataProvider()
303
319
'get_is_in_process_invoke_count ' => 0 ,
304
320
'is_canceled ' => false ,
305
321
'can_unhold ' => true ,
306
- 'is_not_virtual ' => true
322
+ 'is_not_virtual ' => true ,
323
+ 'isPartiallyRefundedOrderShipped ' => false
307
324
],
308
325
'cancelled - isCanceled -> cancelled ' => [
309
326
'can_credit_memo ' => true ,
@@ -316,7 +333,8 @@ public function stateCheckDataProvider()
316
333
'get_is_in_process_invoke_count ' => 0 ,
317
334
'is_canceled ' => true ,
318
335
'can_unhold ' => false ,
319
- 'is_not_virtual ' => true
336
+ 'is_not_virtual ' => true ,
337
+ 'isPartiallyRefundedOrderShipped ' => false
320
338
],
321
339
'processing - !canCreditmemo!canShip -> complete(virtual product) ' => [
322
340
'can_credit_memo ' => false ,
@@ -329,7 +347,8 @@ public function stateCheckDataProvider()
329
347
'get_is_in_process_invoke_count ' => 0 ,
330
348
'is_canceled ' => false ,
331
349
'can_unhold ' => false ,
332
- 'is_not_virtual ' => false
350
+ 'is_not_virtual ' => false ,
351
+ 'isPartiallyRefundedOrderShipped ' => false
333
352
],
334
353
'complete - !canCreditmemo, !canShip - closed(virtual product) ' => [
335
354
'can_credit_memo ' => false ,
@@ -343,6 +362,35 @@ public function stateCheckDataProvider()
343
362
'is_canceled ' => false ,
344
363
'can_unhold ' => false ,
345
364
'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
346
394
],
347
395
];
348
396
}
0 commit comments