/**
  * test method testGetOptionValueModified with option is_percent = false
  */
 public function testGetOptionValueModifiedIsNotPercent()
 {
     $this->saleableItemMock->expects($this->once())->method('setParentId')->with($this->equalTo(true))->will($this->returnValue($this->returnSelf()));
     $this->priceModifier->expects($this->once())->method('modifyPrice')->with($this->equalTo(77.33), $this->equalTo($this->saleableItemMock))->will($this->returnValue(77.67));
     $this->calculatorMock->expects($this->once())->method('getAmount')->with($this->equalTo(77.67), $this->equalTo($this->saleableItemMock), null, [\Magento\Catalog\Pricing\Price\CustomOptionPriceInterface::CONFIGURATION_OPTION_FLAG => true])->will($this->returnValue(80.98999999999999));
     $this->priceCurrency->expects($this->once())->method('convertAndRound')->will($this->returnArgument(0));
     $this->assertEquals(80.98999999999999, $this->attribute->getOptionValueModified(['is_percent' => false, 'pricing_value' => 77.33]));
 }
Esempio n. 2
0
 /**
  *  test for method prepareAdjustmentConfig
  */
 public function testPrepareAdjustmentConfig()
 {
     $expectedAdjustmentConfig = ['includeTax' => false, 'showIncludeTax' => false, 'showBothPrices' => false, 'defaultTax' => 0, 'currentTax' => 0, 'inclTaxTitle' => __('Incl. Tax'), 'product' => $this->saleableItemMock, 'customerId' => 1];
     $this->assertEquals($expectedAdjustmentConfig, $this->attribute->prepareAdjustmentConfig(1));
 }