/**
  * Delete Tax Rate Entity test.
  *
  * @param TaxRate $taxRate
  * @return void
  */
 public function testDeleteTaxRate(TaxRate $taxRate)
 {
     // Precondition
     $taxRate->persist();
     // Steps
     $this->taxRateIndex->open();
     $this->taxRateIndex->getTaxRatesGrid()->searchAndOpen(['code' => $taxRate->getCode()]);
     $this->taxRateEdit->getFormPageActions()->deleteAndAcceptAlert();
 }
 /**
  * Assert tax rule availability in Tax Rate grid.
  *
  * @param TaxRateIndex $taxRateIndexPage
  * @param TaxRate $taxRate
  * @return void
  */
 public function processAssert(TaxRateIndex $taxRateIndexPage, TaxRate $taxRate)
 {
     $data = $taxRate->getData();
     $filter = ['code' => $data['code'], 'tax_country_id' => $data['tax_country_id'], 'tax_postcode' => $data['zip_is_range'] === 'No' ? $data['tax_postcode'] : $data['zip_from'] . '-' . $data['zip_to']];
     $taxRateIndexPage->open();
     \PHPUnit_Framework_Assert::assertTrue($taxRateIndexPage->getTaxRatesGrid()->isRowVisible($filter), "Tax Rate {$filter['code']} is absent in Tax Rate grid.");
 }
 /**
  * Assert that tax rate is absent in Tax Rate grid.
  *
  * @param TaxRateIndex $taxRateIndex
  * @param TaxRate $taxRate
  * @return void
  */
 public function processAssert(TaxRateIndex $taxRateIndex, TaxRate $taxRate)
 {
     $filter = ['code' => $taxRate->getCode()];
     $taxRateIndex->open();
     \PHPUnit_Framework_Assert::assertFalse($taxRateIndex->getTaxRatesGrid()->isRowVisible($filter), 'Tax Rate \'' . $filter['code'] . '\' is present in Tax Rate grid.');
 }