/** * @magentoAppIsolation enabled * @covers \Magento\CatalogRule\Model\Rule::calcProductPriceRule */ public function testCalcProductPriceRule() { $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product'); $this->assertEquals($this->_object->calcProductPriceRule($product, 100), 45); $product->setParentId(true); $this->assertEquals($this->_object->calcProductPriceRule($product, 50), 5); }
/** * {@inheritdoc} */ public function calcProductPriceRule(\Magento\Catalog\Model\Product $product, $price) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'calcProductPriceRule'); if (!$pluginInfo) { return parent::calcProductPriceRule($product, $price); } else { return $this->___callPlugins('calcProductPriceRule', func_get_args(), $pluginInfo); } }