Example #1
0
 /**
  * Tests the getCalculationSequence method
  *
  * @param bool $applyTaxAfterDiscount
  * @param bool $discountTaxIncl
  * @param string $expectedValue
  * @dataProvider dataProviderGetCalculationSequence
  */
 public function testGetCalculationSequence($applyTaxAfterDiscount, $discountTaxIncl, $expectedValue)
 {
     $scopeConfigMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $scopeConfigMock->expects($this->at(0))->method('getValue')->will($this->returnValue($applyTaxAfterDiscount));
     $scopeConfigMock->expects($this->at(1))->method('getValue')->will($this->returnValue($discountTaxIncl));
     /** @var \Magento\Tax\Model\Config */
     $model = new Config($scopeConfigMock);
     $this->assertEquals($expectedValue, $model->getCalculationSequence());
 }
Example #2
0
 /**
  * Get taxes/discounts calculation sequence
  *
  * This sequence depends on "Catalog price include tax", "Apply Tax After Discount"
  * and "Apply Discount On Prices Including Tax" configuration options.
  *
  * @param null|int|string|Store $store
  * @return string
  */
 public function getCalculationSequence($store = null)
 {
     return $this->_config->getCalculationSequence($store);
 }