Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
WeeeTaxTest.php
Go to the documentation of this file.
1 <?php
7 
10 
14 class WeeeTaxTest extends \PHPUnit\Framework\TestCase
15 {
19  const KEY_WEEE_TOTALS = 'weee_total_excl_tax';
20  const KEY_WEEE_BASE_TOTALS = 'weee_base_total_excl_tax';
26  protected $weeeCollector;
27 
31  protected $quoteMock;
32 
37 
38  protected function setUp()
39  {
40  $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
41  $this->quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class);
42  }
43 
50  protected function setupTaxHelper($taxConfig)
51  {
52  $taxHelper = $this->createMock(\Magento\Tax\Helper\Data::class);
53 
54  foreach ($taxConfig as $method => $value) {
55  $taxHelper->expects($this->any())->method($method)->will($this->returnValue($value));
56  }
57 
58  return $taxHelper;
59  }
60 
67  protected function setupWeeeHelper($weeeConfig)
68  {
69  $weeeHelper = $this->createMock(\Magento\Weee\Helper\Data::class);
70 
71  foreach ($weeeConfig as $method => $value) {
72  $weeeHelper->expects($this->any())->method($method)->will($this->returnValue($value));
73  }
74 
75  return $weeeHelper;
76  }
77 
84  protected function setupItemMock($itemQty)
85  {
86  $itemMock = $this->createPartialMock(\Magento\Quote\Model\Quote\Item::class, [
87  'getProduct',
88  'getQuote',
89  'getAddress',
90  'getTotalQty',
91  '__wakeup',
92  ]);
93 
94  $productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
95  $itemMock->expects($this->any())->method('getProduct')->will($this->returnValue($productMock));
96  $itemMock->expects($this->any())->method('getTotalQty')->will($this->returnValue($itemQty));
97 
98  return $itemMock;
99  }
100 
110  protected function setupTotalMock($itemMock, $isWeeeTaxable, $itemWeeeTaxDetails, $addressData)
111  {
112  $totalMock = $this->createPartialMock(\Magento\Quote\Model\Quote\Address\Total::class, [
113  '__wakeup',
114  'getWeeeCodeToItemMap',
115  'getExtraTaxableDetails',
116  'getWeeeTotalExclTax',
117  'getWeeeBaseTotalExclTax',
118  ]);
119 
120  $map = [];
121  $extraDetails = [];
122  $weeeTotals = 0;
123  $weeeBaseTotals = 0;
124 
125  if ($isWeeeTaxable) {
126  $i = 1;
127  $weeeTaxDetails = [];
128  foreach ($itemWeeeTaxDetails as $itemData) {
129  $code = 'weee' . $i++ . '-myWeeeCode';
130  $map[$code] = $itemMock;
131  $weeeTaxDetails[] = [
132  CTC::KEY_TAX_DETAILS_TYPE => 'weee',
133  CTC::KEY_TAX_DETAILS_CODE => $code,
134  CTC::KEY_TAX_DETAILS_PRICE_EXCL_TAX => $itemData['weee_tax_applied_amount'],
135  CTC::KEY_TAX_DETAILS_BASE_PRICE_EXCL_TAX => $itemData['base_weee_tax_applied_amount'],
136  CTC::KEY_TAX_DETAILS_PRICE_INCL_TAX => $itemData['weee_tax_applied_amount_incl_tax'],
137  CTC::KEY_TAX_DETAILS_BASE_PRICE_INCL_TAX =>
138  $itemData['base_weee_tax_applied_amount_incl_tax'],
139  CTC::KEY_TAX_DETAILS_ROW_TOTAL => $itemData['weee_tax_applied_row_amount'],
140  CTC::KEY_TAX_DETAILS_BASE_ROW_TOTAL => $itemData['base_weee_tax_applied_row_amnt'],
141  CTC::KEY_TAX_DETAILS_ROW_TOTAL_INCL_TAX =>
142  $itemData['weee_tax_applied_row_amount_incl_tax'],
143  CTC::KEY_TAX_DETAILS_BASE_ROW_TOTAL_INCL_TAX =>
144  $itemData['base_weee_tax_applied_row_amnt_incl_tax'],
145  ];
146  }
147  $extraDetails = [
148  'weee' => [
149  'sequence-1' => $weeeTaxDetails
150  ],
151  ];
152  } else {
153  if (isset($addressData[self::KEY_WEEE_TOTALS])) {
154  $weeeTotals = $addressData[self::KEY_WEEE_TOTALS];
155  }
156  if (isset($addressData[self::KEY_WEEE_BASE_TOTALS])) {
157  $weeeBaseTotals = $addressData[self::KEY_WEEE_BASE_TOTALS];
158  }
159  }
160 
161  $totalMock->expects($this->any())->method('getWeeeCodeToItemMap')->will($this->returnValue($map));
162  $totalMock->expects($this->any())->method('getExtraTaxableDetails')->will($this->returnValue($extraDetails));
163  $totalMock
164  ->expects($this->any())
165  ->method('getWeeeTotalExclTax')
166  ->will($this->returnValue($weeeTotals));
167  $totalMock
168  ->expects($this->any())
169  ->method('getWeeeBaseTotalExclTax')
170  ->will($this->returnValue($weeeBaseTotals));
171 
172  return $totalMock;
173  }
174 
181  protected function setupShippingAssignmentMock($addressMock, $itemMock)
182  {
183  $shippingMock = $this->createMock(\Magento\Quote\Api\Data\ShippingInterface::class);
184  $shippingMock->expects($this->any())->method('getAddress')->willReturn($addressMock);
185  $shippingAssignmentMock = $this->createMock(\Magento\Quote\Api\Data\ShippingAssignmentInterface::class);
186  $itemMock = $itemMock ? [$itemMock] : [];
187  $shippingAssignmentMock->expects($this->any())->method('getItems')->willReturn($itemMock);
188  $shippingAssignmentMock->expects($this->any())->method('getShipping')->willReturn($shippingMock);
189 
190  return $shippingAssignmentMock;
191  }
192 
199  public function verifyItem($item, $itemData)
200  {
201  if (!$item) {
202  return;
203  }
204  foreach ($itemData as $key => $value) {
205  $this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');
206  }
207  }
208 
216  {
217  foreach ($addressData as $key => $value) {
218  if ($key != self::KEY_WEEE_TOTALS && $key != self::KEY_WEEE_BASE_TOTALS) {
219  // just check the output values
220  $this->assertEquals($value, $address->getData($key), 'address ' . $key . ' is incorrect');
221  }
222  }
223  }
224 
225  public function testFetch()
226  {
227  $serializerMock = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)->getMock();
228  $weeeTotal = 17;
229  $totalMock = new \Magento\Quote\Model\Quote\Address\Total(
230  [],
231  $serializerMock
232  );
233  $taxHelper = $this->setupTaxHelper([]);
234  $weeeHelper = $this->setupWeeeHelper(['getTotalAmounts' => $weeeTotal]);
235  $this->weeeCollector = $this->objectManagerHelper->getObject(
236  \Magento\Weee\Model\Total\Quote\WeeeTax::class,
237  ['taxData' => $taxHelper, 'weeeData' => $weeeHelper]
238  );
239  $expectedResult = [
240  'code' => 'weee',
241  'title' => __('FPT'),
242  'value' => $weeeTotal,
243  'area' => null,
244  ];
245 
246  $this->assertEquals($expectedResult, $this->weeeCollector->fetch($this->quoteMock, $totalMock));
247  }
248 
249  public function testFetchWithZeroAmounts()
250  {
251  $serializerMock = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)->getMock();
252  $totalMock = new \Magento\Quote\Model\Quote\Address\Total(
253  [],
254  $serializerMock
255  );
256  $taxHelper = $this->setupTaxHelper([]);
257  $weeeHelper = $this->setupWeeeHelper(['getTotalAmounts' => null]);
258  $this->weeeCollector = $this->objectManagerHelper->getObject(
259  \Magento\Weee\Model\Total\Quote\WeeeTax::class,
260  ['taxData' => $taxHelper, 'weeeData' => $weeeHelper]
261  );
262 
263  $this->assertNull($this->weeeCollector->fetch($this->quoteMock, $totalMock));
264  }
265 
276  public function testCollect($taxConfig, $weeeConfig, $itemWeeeTaxDetails, $itemQty, $addressData = [])
277  {
278  //Setup
279  if ($itemQty > 0) {
280  $itemMock = $this->setupItemMock($itemQty);
281  } else {
282  $itemMock = null;
283  }
284  $totalMock = $this->setupTotalMock($itemMock, $weeeConfig['isTaxable'], $itemWeeeTaxDetails, $addressData);
285  $addressMock = $this->createMock(\Magento\Quote\Model\Quote\Address::class);
286  $shippingAssignmentMock = $this->setupShippingAssignmentMock($addressMock, $itemMock);
287 
288  $taxHelper = $this->setupTaxHelper($taxConfig);
289  $weeeHelper = $this->setupWeeeHelper($weeeConfig);
290 
291  $arguments = [
292  'taxData' => $taxHelper,
293  'weeeData' => $weeeHelper,
294  ];
295 
296  $this->weeeCollector = $this->objectManagerHelper->getObject(
297  \Magento\Weee\Model\Total\Quote\WeeeTax::class,
298  $arguments
299  );
300 
301  //Execute
302  $this->weeeCollector->collect($this->quoteMock, $shippingAssignmentMock, $totalMock);
303 
304  //Verify
305  $summed = [];
306  foreach ($itemWeeeTaxDetails as $itemWeeeTaxDetail) {
307  foreach ($itemWeeeTaxDetail as $key => $value) {
308  $summed[$key] = (array_key_exists($key, $summed) ? $value + $summed[$key] : $value);
309  }
310  }
311  $this->verifyItem($itemMock, $summed);
312 
313  $this->verifyTotals($totalMock, $addressData);
314  }
315 
324  public function collectDataProvider()
325  {
326  // 1. When the Weee is not taxable, this collector does not change the item, but it will update the address
327  // data based on the weee totals accumulated in the previous 'weee' collector
328  // 2. If the Weee amount is included in the subtotal, then it is not included in the 'weee_amount' field
329 
330  $data = [];
331 
332  $data['price_incl_tax_weee_taxable_unit_included_in_subtotal'] = [
333  'tax_config' => [
334  'priceIncludesTax' => true,
335  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
336  ],
337  'weee_config' => [
338  'isEnabled' => true,
339  'includeInSubtotal' => true,
340  'isTaxable' => true,
341  'getApplied' => [],
342  ],
343  'item_weee_tax_details' => [
344  [
345  'weee_tax_applied_amount' => 9.24,
346  'base_weee_tax_applied_amount' => 9.24,
347  'weee_tax_applied_row_amount' => 18.48,
348  'base_weee_tax_applied_row_amnt' => 18.48,
349  'weee_tax_applied_amount_incl_tax' => 10,
350  'base_weee_tax_applied_amount_incl_tax' => 10,
351  'weee_tax_applied_row_amount_incl_tax' => 20,
352  'base_weee_tax_applied_row_amnt_incl_tax' => 20,
353  ],
354  ],
355  'item_qty' => 2,
356  'address_data' => [
357  'subtotal' => 18.48,
358  'base_subtotal' => 18.48,
359  'subtotal_incl_tax' => 20,
360  'base_subtotal_incl_tax' => 20,
361  'weee_amount' => 0,
362  'base_weee_amount' => 0,
363  ],
364  ];
365 
366  $data['price_incl_tax_weee_taxable_unit_not_included_in_subtotal'] = [
367  'tax_config' => [
368  'priceIncludesTax' => true,
369  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
370  ],
371  'weee_config' => [
372  'isEnabled' => true,
373  'includeInSubtotal' => false,
374  'isTaxable' => true,
375  'getApplied' => [],
376  ],
377  'item_weee_tax_details' => [
378  [
379  'weee_tax_applied_amount' => 9.24,
380  'base_weee_tax_applied_amount' => 9.24,
381  'weee_tax_applied_row_amount' => 18.48,
382  'base_weee_tax_applied_row_amnt' => 18.48,
383  'weee_tax_applied_amount_incl_tax' => 10,
384  'base_weee_tax_applied_amount_incl_tax' => 10,
385  'weee_tax_applied_row_amount_incl_tax' => 20,
386  'base_weee_tax_applied_row_amnt_incl_tax' => 20,
387  ],
388  ],
389  'item_qty' => 2,
390  'address_data' => [
391  'subtotal' => 0,
392  'base_subtotal' => 0,
393  'subtotal_incl_tax' => 20,
394  'base_subtotal_incl_tax' => 20,
395  'weee_amount' => 18.48,
396  'base_weee_amount' => 18.48,
397  ],
398  ];
399 
400  $data['price_excl_tax_weee_taxable_unit_included_in_subtotal'] = [
401  'tax_config' => [
402  'priceIncludesTax' => false,
403  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
404  ],
405  'weee_config' => [
406  'isEnabled' => true,
407  'includeInSubtotal' => true,
408  'isTaxable' => true,
409  'getApplied' => [],
410  ],
411  'item_weee_tax_details' => [
412  [
413  'weee_tax_applied_amount' => 10,
414  'base_weee_tax_applied_amount' => 10,
415  'weee_tax_applied_row_amount' => 20,
416  'base_weee_tax_applied_row_amnt' => 20,
417  'weee_tax_applied_amount_incl_tax' => 10.83,
418  'base_weee_tax_applied_amount_incl_tax' => 10.83,
419  'weee_tax_applied_row_amount_incl_tax' => 21.66,
420  'base_weee_tax_applied_row_amnt_incl_tax' => 21.66,
421  ],
422  ],
423  'item_qty' => 2,
424  'address_data' => [
425  'subtotal' => 20,
426  'base_subtotal' => 20,
427  'subtotal_incl_tax' => 21.66,
428  'base_subtotal_incl_tax' => 21.66,
429  'weee_amount' => 0,
430  'base_weee_amount' => 0,
431  ],
432  ];
433 
434  $data['price_incl_tax_weee_non_taxable_unit_included_in_subtotal'] = [
435  'tax_config' => [
436  'priceIncludesTax' => true,
437  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
438  ],
439  'weee_config' => [
440  'isEnabled' => true,
441  'includeInSubtotal' => true,
442  'isTaxable' => false,
443  'getApplied' => [],
444  ],
445  'item_weee_tax_details' => [
446  ],
447  'item_qty' => 2,
448  'address_data' => [
449  self::KEY_WEEE_TOTALS => 20,
450  self::KEY_WEEE_BASE_TOTALS => 20,
451  'subtotal' => 20,
452  'base_subtotal' => 20,
453  'subtotal_incl_tax' => 20,
454  'base_subtotal_incl_tax' => 20,
455  'weee_amount' => 0,
456  'base_weee_amount' => 0,
457  ],
458  ];
459 
460  $data['price_excl_tax_weee_non_taxable_unit_include_in_subtotal'] = [
461  'tax_config' => [
462  'priceIncludesTax' => false,
463  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
464  ],
465  'weee_config' => [
466  'isEnabled' => true,
467  'includeInSubtotal' => true,
468  'isTaxable' => false,
469  'getApplied' => [],
470  ],
471  'item_weee_tax_details' => [
472  ],
473  'item_qty' => 2,
474  'address_data' => [
475  self::KEY_WEEE_TOTALS => 20,
476  self::KEY_WEEE_BASE_TOTALS => 20,
477  'subtotal' => 20,
478  'base_subtotal' => 20,
479  'subtotal_incl_tax' => 20,
480  'base_subtotal_incl_tax' => 20,
481  'weee_amount' => 0,
482  'base_weee_amount' => 0,
483  ],
484  ];
485 
486  $data['price_incl_tax_weee_taxable_row_include_in_subtotal'] = [
487  'tax_config' => [
488  'priceIncludesTax' => true,
489  'getCalculationAlgorithm' => Calculation::CALC_ROW_BASE,
490  ],
491  'weee_config' => [
492  'isEnabled' => true,
493  'includeInSubtotal' => true,
494  'isTaxable' => true,
495  'getApplied' => [],
496  ],
497  'item_weee_tax_details' => [
498  [
499  'weee_tax_applied_amount' => 9.24,
500  'base_weee_tax_applied_amount' => 9.24,
501  'weee_tax_applied_row_amount' => 18.48,
502  'base_weee_tax_applied_row_amnt' => 18.48,
503  'weee_tax_applied_amount_incl_tax' => 10,
504  'base_weee_tax_applied_amount_incl_tax' => 10,
505  'weee_tax_applied_row_amount_incl_tax' => 20,
506  'base_weee_tax_applied_row_amnt_incl_tax' => 20,
507  ],
508  ],
509  'item_qty' => 2,
510  'address_data' => [
511  'subtotal' => 18.48,
512  'base_subtotal' => 18.48,
513  'subtotal_incl_tax' => 20,
514  'base_subtotal_incl_tax' => 20,
515  'weee_amount' => 0,
516  'base_weee_amount' => 0,
517  ],
518  ];
519 
520  $data['price_excl_tax_weee_taxable_row_include_in_subtotal'] = [
521  'tax_config' => [
522  'priceIncludesTax' => false,
523  'getCalculationAlgorithm' => Calculation::CALC_ROW_BASE,
524  ],
525  'weee_config' => [
526  'isEnabled' => true,
527  'includeInSubtotal' => true,
528  'isTaxable' => true,
529  'getApplied' => [],
530  ],
531  'item_weee_tax_details' => [
532  [
533  'weee_tax_applied_amount' => 10,
534  'base_weee_tax_applied_amount' => 10,
535  'weee_tax_applied_row_amount' => 20,
536  'base_weee_tax_applied_row_amnt' => 20,
537  'weee_tax_applied_amount_incl_tax' => 10.83,
538  'base_weee_tax_applied_amount_incl_tax' => 10.83,
539  'weee_tax_applied_row_amount_incl_tax' => 21.65,
540  'base_weee_tax_applied_row_amnt_incl_tax' => 21.65,
541  ],
542  ],
543  'item_qty' => 2,
544  'address_data' => [
545  'subtotal' => 20,
546  'base_subtotal' => 20,
547  'subtotal_incl_tax' => 21.65,
548  'base_subtotal_incl_tax' => 21.65,
549  'weee_amount' => 0,
550  'base_weee_amount' => 0,
551  ],
552  ];
553 
554  $data['price_incl_tax_weee_non_taxable_row_include_in_subtotal'] = [
555  'tax_config' => [
556  'priceIncludesTax' => true,
557  'getCalculationAlgorithm' => Calculation::CALC_ROW_BASE,
558  ],
559  'weee_config' => [
560  'isEnabled' => true,
561  'includeInSubtotal' => true,
562  'isTaxable' => false,
563  'getApplied' => [],
564  ],
565  'item_weee_tax_details' => [
566  ],
567  'item_qty' => 2,
568  'address_data' => [
569  self::KEY_WEEE_TOTALS => 20,
570  self::KEY_WEEE_BASE_TOTALS => 20,
571  'subtotal' => 20,
572  'base_subtotal' => 20,
573  'subtotal_incl_tax' => 20,
574  'base_subtotal_incl_tax' => 20,
575  'weee_amount' => 0,
576  'base_weee_amount' => 0,
577  ],
578  ];
579 
580  $data['price_excl_tax_weee_non_taxable_row_not_included_in_subtotal'] = [
581  'tax_config' => [
582  'priceIncludesTax' => false,
583  'getCalculationAlgorithm' => Calculation::CALC_ROW_BASE,
584  ],
585  'weee_config' => [
586  'isEnabled' => true,
587  'includeInSubtotal' => false,
588  'isTaxable' => false,
589  'getApplied' => [],
590  ],
591  'item_weee_tax_details' => [
592  ],
593  'item_qty' => 2,
594  'address_data' => [
595  self::KEY_WEEE_TOTALS => 20,
596  self::KEY_WEEE_BASE_TOTALS => 20,
597  'subtotal' => 0,
598  'base_subtotal' => 0,
599  'subtotal_incl_tax' => 20,
600  'base_subtotal_incl_tax' => 20,
601  'weee_amount' => 20,
602  'base_weee_amount' => 20,
603  ],
604  ];
605 
606  $data['price_excl_tax_weee_taxable_unit_not_included_in_subtotal'] = [
607  'tax_config' => [
608  'priceIncludesTax' => false,
609  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
610  ],
611  'weee_config' => [
612  'isEnabled' => true,
613  'includeInSubtotal' => false,
614  'isTaxable' => true,
615  'getApplied' => [],
616  ],
617  'item_weee_tax_details' => [
618  [
619  'weee_tax_applied_amount' => 10,
620  'base_weee_tax_applied_amount' => 10,
621  'weee_tax_applied_row_amount' => 20,
622  'base_weee_tax_applied_row_amnt' => 20,
623  'weee_tax_applied_amount_incl_tax' => 11.00,
624  'base_weee_tax_applied_amount_incl_tax' => 11.00,
625  'weee_tax_applied_row_amount_incl_tax' => 22.00,
626  'base_weee_tax_applied_row_amnt_incl_tax' => 22.00,
627  ],
628  [
629  'weee_tax_applied_amount' => 2,
630  'base_weee_tax_applied_amount' => 2,
631  'weee_tax_applied_row_amount' => 4,
632  'base_weee_tax_applied_row_amnt' => 4,
633  'weee_tax_applied_amount_incl_tax' => 2.20,
634  'base_weee_tax_applied_amount_incl_tax' => 2.20,
635  'weee_tax_applied_row_amount_incl_tax' => 4.40,
636  'base_weee_tax_applied_row_amnt_incl_tax' => 4.40,
637  ],
638  ],
639  'item_qty' => 2,
640  'address_data' => [
641  'subtotal' => 0,
642  'base_subtotal' => 0,
643  'subtotal_incl_tax' => 26.40,
644  'base_subtotal_incl_tax' => 26.40,
645  'weee_amount' => 24,
646  'base_weee_amount' => 24,
647  ],
648  ];
649 
650  $data['weee_disabled'] = [
651  'tax_config' => [
652  'priceIncludesTax' => false,
653  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
654  ],
655  'weee_config' => [
656  'isEnabled' => false,
657  'includeInSubtotal' => false,
658  'isTaxable' => true,
659  'getApplied' => [],
660  ],
661  'item_weee_tax_details' => [
662  [
663  'weee_tax_applied_amount' => null,
664  'base_weee_tax_applied_amount' => null,
665  'weee_tax_applied_row_amount' => null,
666  'base_weee_tax_applied_row_amnt' => null,
667  'weee_tax_applied_amount_incl_tax' => null,
668  'base_weee_tax_applied_amount_incl_tax' => null,
669  'weee_tax_applied_row_amount_incl_tax' => null,
670  'base_weee_tax_applied_row_amnt_incl_tax' => null,
671  ],
672  [
673  'weee_tax_applied_amount' => null,
674  'base_weee_tax_applied_amount' => null,
675  'weee_tax_applied_row_amount' => null,
676  'base_weee_tax_applied_row_amnt' => null,
677  'weee_tax_applied_amount_incl_tax' => null,
678  'base_weee_tax_applied_amount_incl_tax' => null,
679  'weee_tax_applied_row_amount_incl_tax' => null,
680  'base_weee_tax_applied_row_amnt_incl_tax' => null,
681  ],
682  ],
683  'item_qty' => 1,
684  'address_data' => [
685  'subtotal' => null,
686  'base_subtotal' => null,
687  'subtotal_incl_tax' => null,
688  'base_subtotal_incl_tax' => null,
689  'weee_amount' => null,
690  'base_weee_amount' => null,
691  ],
692  ];
693 
694  $data['zero_items'] = [
695  'tax_config' => [
696  'priceIncludesTax' => false,
697  'getCalculationAlgorithm' => Calculation::CALC_UNIT_BASE,
698  ],
699  'weee_config' => [
700  'isEnabled' => true,
701  'includeInSubtotal' => false,
702  'isTaxable' => true,
703  'getApplied' => [],
704  ],
705  'item_weee_tax_details' => [
706  [
707  'weee_tax_applied_amount' => null,
708  'base_weee_tax_applied_amount' => null,
709  'weee_tax_applied_row_amount' => null,
710  'base_weee_tax_applied_row_amnt' => null,
711  'weee_tax_applied_amount_incl_tax' => null,
712  'base_weee_tax_applied_amount_incl_tax' => null,
713  'weee_tax_applied_row_amount_incl_tax' => null,
714  'base_weee_tax_applied_row_amnt_incl_tax' => null,
715  ],
716  [
717  'weee_tax_applied_amount' => null,
718  'base_weee_tax_applied_amount' => null,
719  'weee_tax_applied_row_amount' => null,
720  'base_weee_tax_applied_row_amnt' => null,
721  'weee_tax_applied_amount_incl_tax' => null,
722  'base_weee_tax_applied_amount_incl_tax' => null,
723  'weee_tax_applied_row_amount_incl_tax' => null,
724  'base_weee_tax_applied_row_amnt_incl_tax' => null,
725  ],
726  ],
727  'item_qty' => 0,
728  'address_data' => [
729  'subtotal' => null,
730  'base_subtotal' => null,
731  'subtotal_incl_tax' => null,
732  'base_subtotal_incl_tax' => null,
733  'weee_amount' => null,
734  'base_weee_amount' => null,
735  ],
736  ];
737 
738  return $data;
739  }
740 }
testCollect($taxConfig, $weeeConfig, $itemWeeeTaxDetails, $itemQty, $addressData=[])
__()
Definition: __.php:13
$address
Definition: customer.php:38
$addressData
Definition: order.php:19
$value
Definition: gender.phtml:16
$method
Definition: info.phtml:13
$arguments
$i
Definition: gallery.phtml:31
setupTotalMock($itemMock, $isWeeeTaxable, $itemWeeeTaxDetails, $addressData)
$code
Definition: info.phtml:12