/** * @expectedException \Magento\Framework\Exception\InputException */ public function testUpdateTaxRuleMissingRequiredInfo() { $taxRuleBuilder = $this->objectManager->getObject('Magento\\Tax\\Service\\V1\\Data\\TaxRuleBuilder'); $taxRule = $taxRuleBuilder->setId(3)->setCode(null)->setCustomerTaxClassIds([3])->setProductTaxClassIds([2])->setTaxRateIds([2])->setPriority(0)->setSortOrder(1)->create(); $this->taxRuleService->updateTaxRule($taxRule); }
/** * @magentoDbIsolation enabled * @expectedException \Magento\Framework\Exception\InputException * @expectedExceptionMessage code */ public function testUpdateTaxRuleMissingRequiredFields() { $taxRuleServiceData = $this->taxRuleService->createTaxRule($this->createTaxRuleDataObject()); $updatedTaxRule = $this->taxRuleBuilder->populate($taxRuleServiceData)->setCode(null)->create(); $this->taxRuleService->updateTaxRule($updatedTaxRule); }