@@ -210,93 +210,6 @@ public function testAfterSave(
210
210
*/
211
211
public function afterSaveDataProvider ()
212
212
{
213
- $ orderTaxDetailsApplied = $ this ->getMockBuilder (\Magento \Tax \Api \Data \OrderTaxDetailsAppliedTaxInterface::class)
214
- ->disableOriginalConstructor ()
215
- ->setMethods (['getRates ' ])
216
- ->getMockForAbstractClass ();
217
-
218
- $ orderTaxDetailsApplied ->expects ($ this ->at (0 ))
219
- ->method ('getRates ' )
220
- ->willReturn (
221
- [
222
- [
223
- 'percent ' => 6 ,
224
- 'code ' => 'IL ' ,
225
- 'title ' => 'IL ' ,
226
- ],
227
- [
228
- 'percent ' => 5 ,
229
- 'code ' => 'US ' ,
230
- 'title ' => 'US ' ,
231
- ]
232
- ]
233
- );
234
- $ orderTaxDetailsApplied ->expects ($ this ->at (1 ))
235
- ->method ('getRates ' )
236
- ->willReturn (
237
- [
238
- [
239
- 'percent ' => 3 ,
240
- 'code ' => 'CityTax ' ,
241
- 'title ' => 'CityTax ' ,
242
- ],
243
- ]
244
- );
245
- $ orderTaxDetailsApplied ->expects ($ this ->at (2 ))
246
- ->method ('getRates ' )
247
- ->willReturn (
248
- [
249
- [
250
- 'percent ' => 6 ,
251
- 'code ' => 'IL ' ,
252
- 'title ' => 'IL ' ,
253
- ],
254
- [
255
- 'percent ' => 5 ,
256
- 'code ' => 'US ' ,
257
- 'title ' => 'US ' ,
258
- ],
259
- ]
260
- );
261
- $ orderTaxDetailsApplied ->expects ($ this ->at (3 ))
262
- ->method ('getRates ' )
263
- ->willReturn (
264
- [
265
- [
266
- 'percent ' => 3 ,
267
- 'code ' => 'CityTax ' ,
268
- 'title ' => 'CityTax ' ,
269
- ],
270
- ]
271
- );
272
- $ orderTaxDetailsApplied ->expects ($ this ->at (4 ))
273
- ->method ('getRates ' )
274
- ->willReturn (
275
- [
276
- [
277
- 'percent ' => 6 ,
278
- 'code ' => 'IL ' ,
279
- 'title ' => 'IL ' ,
280
- ],
281
- [
282
- 'percent ' => 5 ,
283
- 'code ' => 'US ' ,
284
- 'title ' => 'US ' ,
285
- ],
286
- ]
287
- );
288
- $ orderTaxDetailsApplied ->expects ($ this ->at (5 ))
289
- ->method ('getRates ' )
290
- ->willReturn (
291
- [
292
- [
293
- 'percent ' => 3 ,
294
- 'code ' => 'CityTax ' ,
295
- 'title ' => 'CityTax ' ,
296
- ],
297
- ]
298
- );
299
-
300
213
return [
301
214
//one item with shipping
302
215
//three tax rates: state and national tax rates of 6 and 5 percent with priority 0
@@ -308,14 +221,35 @@ public function afterSaveDataProvider()
308
221
'base_amount ' => 0.66 ,
309
222
'percent ' => 11 ,
310
223
'id ' => 'ILUS ' ,
311
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
224
+ 'extension_attributes ' => [
225
+ 'rates ' => [
226
+ [
227
+ 'percent ' => 6 ,
228
+ 'code ' => 'IL ' ,
229
+ 'title ' => 'IL ' ,
230
+ ],
231
+ [
232
+ 'percent ' => 5 ,
233
+ 'code ' => 'US ' ,
234
+ 'title ' => 'US ' ,
235
+ ],
236
+ ]
237
+ ],
312
238
],
313
239
[
314
240
'amount ' => 0.2 ,
315
241
'base_amount ' => 0.2 ,
316
242
'percent ' => 3.33 ,
317
243
'id ' => 'CityTax ' ,
318
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
244
+ 'extension_attributes ' => [
245
+ 'rates ' => [
246
+ [
247
+ 'percent ' => 3 ,
248
+ 'code ' => 'CityTax ' ,
249
+ 'title ' => 'CityTax ' ,
250
+ ],
251
+ ]
252
+ ],
319
253
],
320
254
],
321
255
'item_applied_taxes ' => [
@@ -331,15 +265,36 @@ public function afterSaveDataProvider()
331
265
'base_amount ' => 0.11 ,
332
266
'percent ' => 11 ,
333
267
'id ' => 'ILUS ' ,
334
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
268
+ 'extension_attributes ' => [
269
+ 'rates ' => [
270
+ [
271
+ 'percent ' => 6 ,
272
+ 'code ' => 'IL ' ,
273
+ 'title ' => 'IL ' ,
274
+ ],
275
+ [
276
+ 'percent ' => 5 ,
277
+ 'code ' => 'US ' ,
278
+ 'title ' => 'US ' ,
279
+ ],
280
+ ]
281
+ ],
335
282
],
336
283
//city tax
337
284
[
338
285
'amount ' => 0.03 ,
339
286
'base_amount ' => 0.03 ,
340
287
'percent ' => 3.33 ,
341
288
'id ' => 'CityTax ' ,
342
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
289
+ 'extension_attributes ' => [
290
+ 'rates ' => [
291
+ [
292
+ 'percent ' => 3 ,
293
+ 'code ' => 'CityTax ' ,
294
+ 'title ' => 'CityTax ' ,
295
+ ],
296
+ ]
297
+ ],
343
298
],
344
299
],
345
300
],
@@ -355,15 +310,36 @@ public function afterSaveDataProvider()
355
310
'base_amount ' => 0.55 ,
356
311
'percent ' => 11 ,
357
312
'id ' => 'ILUS ' ,
358
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
313
+ 'extension_attributes ' => [
314
+ 'rates ' => [
315
+ [
316
+ 'percent ' => 6 ,
317
+ 'code ' => 'IL ' ,
318
+ 'title ' => 'IL ' ,
319
+ ],
320
+ [
321
+ 'percent ' => 5 ,
322
+ 'code ' => 'US ' ,
323
+ 'title ' => 'US ' ,
324
+ ],
325
+ ]
326
+ ],
359
327
],
360
328
//city tax
361
329
[
362
330
'amount ' => 0.17 ,
363
331
'base_amount ' => 0.17 ,
364
332
'percent ' => 3.33 ,
365
333
'id ' => 'CityTax ' ,
366
- 'extension_attributes ' => $ orderTaxDetailsApplied ,
334
+ 'extension_attributes ' => [
335
+ 'rates ' => [
336
+ [
337
+ 'percent ' => 3 ,
338
+ 'code ' => 'CityTax ' ,
339
+ 'title ' => 'CityTax ' ,
340
+ ],
341
+ ]
342
+ ],
367
343
],
368
344
],
369
345
],
0 commit comments