/** * @return \Orm\Zed\Tax\Persistence\SpyTaxRateQuery */ public function createTaxRateQuery() { return SpyTaxRateQuery::create(); }
/** * @return void */ public function testDeleteTaxSetShouldDeleteSetButNotTheAssociatedRate() { $taxRateTransfer = $this->createTaxRateTransfer(); $rateId = $this->taxFacade->createTaxRate($taxRateTransfer)->getIdTaxRate(); $taxRateTransfer->setIdTaxRate($rateId); $taxRateQuery = SpyTaxRateQuery::create()->filterByIdTaxRate($rateId); $taxRateEntity = $taxRateQuery->findOne(); $this->assertNotEmpty($taxRateEntity); $taxSetTransfer = $this->createTaxSetTransfer(); $taxSetTransfer->addTaxRate($taxRateTransfer); $setId = $this->taxFacade->createTaxSet($taxSetTransfer)->getIdTaxSet(); $taxSetQuery = SpyTaxSetQuery::create()->filterByIdTaxSet($setId); $taxSetEntity = $taxSetQuery->findOne(); $this->assertNotEmpty($taxSetEntity); $this->taxFacade->deleteTaxSet($setId); $taxRateEntity = $taxRateQuery->findOne(); $this->assertNotEmpty($taxRateEntity); $taxSetEntity = $taxSetQuery->findOne(); $this->assertEmpty($taxSetEntity); }