40 $this->weeeHelperMock = $this->createMock(\
Magento\Weee\Helper\Data::class);
41 $this->taxHelperMock = $this->createMock(\
Magento\Tax\Helper\Data::class);
42 $this->priceCurrencyMock = $this->createMock(\
Magento\Framework\Pricing\PriceCurrencyInterface::class);
43 $this->priceCurrencyMock->expects($this->any())
44 ->method(
'convertAndRound')
46 $this->returnCallback(
48 return round($arg * 0.5, 2);
52 $this->priceCurrencyMock->expects($this->any())
55 $this->returnCallback(
63 $this->weeeHelperMock,
65 $this->priceCurrencyMock,
77 $this->assertFalse($this->adjustment->isIncludedInBasePrice());
93 $this->weeeHelperMock->expects($this->any())
96 $this->weeeHelperMock->expects($this->any())
98 ->willReturn($isWeeeTaxable);
99 $this->taxHelperMock->expects($this->any())
100 ->method(
'displayPriceExcludingTax')
101 ->willReturn($taxDisplayExclTax);
106 $this->weeeHelperMock->expects($this->any())
107 ->method(
'typeOfDisplay')
108 ->with($displayTypes)
109 ->will($this->returnValue($weeeDisplayConfig));
111 $this->assertEquals($expectedResult, $this->adjustment->isIncludedInDisplayPrice());
120 'display_incl_tax' => [
121 'tax_display_excl_tax' =>
false,
122 'is_weee_taxable' =>
true,
123 'weee_display_config' =>
false,
124 'expected_result' =>
true,
126 'display_incl_tax_excl_weee' => [
127 'tax_display_excl_tax' =>
false,
128 'is_weee_taxable' =>
true,
129 'weee_display_config' =>
true,
130 'expected_result' =>
false,
132 'display_excl_tax' => [
133 'tax_display_excl_tax' =>
true,
134 'is_weee_taxable' =>
true,
135 'weee_display_config' =>
true,
136 'expected_result' =>
false,
138 'display_excl_tax_incl_weee' => [
139 'tax_display_excl_tax' =>
true,
140 'is_weee_taxable' =>
true,
141 'weee_display_config' =>
false,
142 'expected_result' =>
false,
155 $object = $this->getMockForAbstractClass(\
Magento\Framework\Pricing\SaleableInterface::class);
157 $this->weeeHelperMock->expects($this->any())
158 ->method(
'getProductWeeeAttributes')
159 ->will($this->returnValue($weeeAttributes));
161 $this->assertEquals($expectedResult, $this->adjustment->applyAdjustment(
$amount, $object));
172 'weee_attributes' => [
173 new \Magento\Framework\DataObject(
178 new \Magento\Framework\DataObject(
185 'expected_result' => 13.75,
applyAdjustmentDataProvider()
testApplyAdjustment($amount, $weeeAttributes, $expectedResult)
testIsIncludedInBasePrice()
testIsIncludedInDisplayPrice( $taxDisplayExclTax, $isWeeeTaxable, $weeeDisplayConfig, $expectedResult)
isIncludedInDisplayPriceDataProvider()