/**
  * Assert that required tax rate is present in "Tax Rule Information" on tax rule creation page.
  *
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRuleNew $taxRuleNew
  * @param TaxRate $taxRate
  * @return void
  */
 public function processAssert(TaxRuleIndex $taxRuleIndex, TaxRuleNew $taxRuleNew, TaxRate $taxRate)
 {
     $taxRateCode = $taxRate->getCode();
     $taxRuleIndex->open();
     $taxRuleIndex->getGridPageActions()->addNew();
     \PHPUnit_Framework_Assert::assertTrue($taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxRateCode), "{$taxRateCode} is not present in Tax Rates multiselect on tax rule creation page.");
 }
 /**
  * Delete Tax Rate Entity test.
  *
  * @param TaxRate $taxRate
  * @return void
  */
 public function testDeleteTaxRate(TaxRate $taxRate)
 {
     // Precondition
     $taxRate->persist();
     // Steps
     $filter = ['code' => $taxRate->getCode()];
     $this->taxRateIndex->open();
     $this->taxRateIndex->getTaxRateGrid()->searchAndOpen($filter);
     $this->taxRateNew->getFormPageActions()->delete();
 }
 /**
  * Update Tax Rate Entity test.
  *
  * @param TaxRate $initialTaxRate
  * @param TaxRate $taxRate
  * @return void
  */
 public function testUpdateTaxRate(TaxRate $initialTaxRate, TaxRate $taxRate)
 {
     // Precondition
     $initialTaxRate->persist();
     // Steps
     $filter = ['code' => $initialTaxRate->getCode()];
     $this->taxRateIndex->open();
     $this->taxRateIndex->getTaxRateGrid()->searchAndOpen($filter);
     $this->taxRateNew->getTaxRateForm()->fill($taxRate);
     $this->taxRateNew->getFormPageActions()->save();
 }
 /**
  * Assert that tax rate not available 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->getTaxRateGrid()->isRowVisible($filter), 'Tax Rate \'' . $filter['code'] . '\' is present in Tax Rate grid.');
 }
 /**
  * Assert that tax rate is absent in tax rule form
  *
  * @param TaxRate $taxRate
  * @param TaxRuleNew $taxRuleNew
  * @return void
  */
 public function processAssert(TaxRate $taxRate, TaxRuleNew $taxRuleNew)
 {
     $taxRuleNew->open();
     $taxRatesList = $taxRuleNew->getTaxRuleForm()->getAllTaxRates();
     \PHPUnit_Framework_Assert::assertFalse(in_array($taxRate->getCode(), $taxRatesList), 'Tax Rate \'' . $taxRate->getCode() . '\' is present in Tax Rule form.');
 }