Exemplo n.º 1
0
 /**
  * Delete all Tax Rules on backend.
  *
  * @return array
  */
 public function run()
 {
     $this->taxRuleIndexPage->open();
     $this->taxRuleIndexPage->getTaxRuleGrid()->resetFilter();
     while ($this->taxRuleIndexPage->getTaxRuleGrid()->isFirstRowVisible()) {
         $this->taxRuleIndexPage->getTaxRuleGrid()->openFirstRow();
         $this->taxRuleNewPage->getFormPageActions()->delete();
     }
 }
Exemplo n.º 2
0
 /**
  * Assert that tax rule form filled right.
  *
  * @param TaxRuleNew $taxRuleNew
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRule $taxRule
  * @return void
  */
 public function processAssert(TaxRuleNew $taxRuleNew, TaxRuleIndex $taxRuleIndex, TaxRule $taxRule)
 {
     $fixtureData = $taxRule->getData();
     $taxRuleIndex->open();
     $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]);
     $formData = $taxRuleNew->getTaxRuleForm()->getData($taxRule);
     $dataDiff = $this->verifyForm($formData, $fixtureData);
     \PHPUnit_Framework_Assert::assertEmpty($dataDiff, implode($dataDiff));
 }
Exemplo n.º 3
0
 /**
  * Assert tax rule availability in Tax Rule grid.
  *
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRule $taxRule
  * @return void
  */
 public function processAssert(TaxRuleIndex $taxRuleIndex, TaxRule $taxRule)
 {
     $filter = ['code' => $taxRule->getCode()];
     $taxRuleIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($taxRuleIndex->getTaxRuleGrid()->isRowVisible($filter), "Tax Rule '{$filter['code']}' is absent in Tax Rule grid.");
 }