/** * test for method afterPrepareAdjustmentConfig */ public function testAfterPrepareAdjustmentConfig() { $this->productMock->expects($this->once())->method('getTaxClassId')->will($this->returnValue('tax-class-id')); $this->calculationMock->expects($this->exactly(2))->method('getRateRequest')->will($this->returnValue($this->rateRequestMock)); $this->calculationMock->expects($this->exactly(2))->method('getRate')->with($this->equalTo($this->rateRequestMock))->will($this->returnValue(99.09999999999999)); $this->productMock->expects($this->once())->method('getPriceInfo')->will($this->returnValue($this->priceInfoMock)); $this->priceInfoMock->expects($this->once())->method('getAdjustment')->with($this->equalTo(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE))->will($this->returnValue($this->adjustmentMock)); $this->adjustmentMock->expects($this->once())->method('isIncludedInBasePrice')->will($this->returnValue(true)); $this->taxHelperMock->expects($this->once())->method('displayPriceIncludingTax')->will($this->returnValue(true)); $this->taxHelperMock->expects($this->once())->method('displayBothPrices')->will($this->returnValue(true)); $expected = ['product' => $this->productMock, 'defaultTax' => 99.09999999999999, 'currentTax' => 99.09999999999999, 'customerId' => 1, 'includeTax' => true, 'showIncludeTax' => true, 'showBothPrices' => true]; $this->assertEquals($expected, $this->plugin->afterPrepareAdjustmentConfig($this->attributePriceMock, ['product' => $this->productMock, 'defaultTax' => 0, 'currentTax' => 0, 'customerId' => 1])); }
public function testGetSortOrder() { $this->assertEquals($this->sortOrder, $this->adjustment->getSortOrder()); }