9 use \Magento\Weee\Pricing\Adjustment;
38 $this->weeeHelper = $this->createMock(\
Magento\Weee\Helper\Data::class);
39 $this->priceCurrencyMock = $this->createMock(\
Magento\Framework\Pricing\PriceCurrencyInterface::class);
40 $this->priceCurrencyMock->expects($this->any())
41 ->method(
'convertAndRound')
43 $this->returnCallback(
45 return round($arg * 0.5, 2);
49 $this->priceCurrencyMock->expects($this->any())
52 $this->returnCallback(
59 $this->adjustment =
new Adjustment($this->weeeHelper, $this->priceCurrencyMock, $this->sortOrder);
69 $this->assertFalse($this->adjustment->isIncludedInBasePrice());
82 $this->weeeHelper->expects($this->any())
83 ->method(
'typeOfDisplay')
85 ->will($this->returnValue($expectedResult));
87 $this->assertEquals($expectedResult, $this->adjustment->isIncludedInDisplayPrice());
95 return [[
false], [
true]];
106 $object = $this->getMockForAbstractClass(\
Magento\Framework\Pricing\SaleableInterface::class);
108 $this->weeeHelper->expects($this->any())
109 ->method(
'getAmountExclTax')
110 ->will($this->returnValue($amountOld));
112 $this->assertEquals($expectedResult, $this->adjustment->applyAdjustment(
$amount, $object));
134 $this->assertEquals($expectedResult, $this->adjustment->isExcludedWith($adjustmentCode));
145 [
'not_tax_and_not_weee',
false]
156 $this->weeeHelper->expects($this->any())
157 ->method(
'isTaxable')
158 ->will($this->returnValue($isTaxable));
160 $this->assertEquals($expectedResult, $this->adjustment->getSortOrder());
isExcludedWithDataProvider()
isIncludedInDisplayPriceDataProvider()
applyAdjustmentDataProvider()
testApplyAdjustment($amount, $amountOld, $expectedResult)
const DISPLAY_EXCL_DESCR_INCL
testIsIncludedInBasePrice()
testIsIncludedInDisplayPrice($expectedResult)
testGetSortOrder($isTaxable, $expectedResult)
testIsExcludedWith($adjustmentCode, $expectedResult)