コード例 #1
0
 /**
  * Delete Tax Rule on backend
  *
  * @return array
  */
 public function run()
 {
     $this->taxRuleIndexPage->open();
     while ($this->taxRuleIndexPage->getTaxRuleGrid()->isFirstRowVisible()) {
         $this->taxRuleIndexPage->getTaxRuleGrid()->openFirstRow();
         $this->taxRuleNewPage->getFormPageActions()->delete();
     }
 }
コード例 #2
0
 /**
  * Delete Tax Rule Entity test.
  *
  * @param TaxRule $taxRule
  * @return void
  */
 public function testDeleteTaxRule(TaxRule $taxRule)
 {
     // Precondition
     $taxRule->persist();
     // Steps
     $this->taxRuleIndexPage->open();
     $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]);
     $this->taxRuleNewPage->getFormPageActions()->delete();
 }
コード例 #3
0
 /**
  * Update Tax Rule Entity test.
  *
  * @param TaxRule $initialTaxRule
  * @param TaxRule $taxRule
  * @return void
  */
 public function testUpdateTaxRule(TaxRule $initialTaxRule, TaxRule $taxRule)
 {
     // Precondition
     $initialTaxRule->persist();
     // Steps
     $this->taxRuleIndexPage->open();
     $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen(['code' => $initialTaxRule->getCode()]);
     $this->taxRuleNewPage->getTaxRuleForm()->fill($taxRule);
     $this->taxRuleNewPage->getFormPageActions()->save();
 }
コード例 #4
0
 /**
  * Delete Tax Rule 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();
         $this->taxRuleNewPage->getModalBlock()->acceptAlert();
     }
 }
コード例 #5
0
 /**
  * Delete Tax Rule Entity test
  *
  * @param TaxRule $taxRule
  * @param AddressInjectable $address
  * @param array $shipping
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function testDeleteTaxRule(TaxRule $taxRule, AddressInjectable $address, array $shipping)
 {
     // Precondition
     $taxRule->persist();
     // Steps
     $filters = ['code' => $taxRule->getCode()];
     $this->taxRuleIndexPage->open();
     $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen($filters);
     $this->taxRuleNewPage->getFormPageActions()->delete();
 }
コード例 #6
0
 /**
  * Assert tax rule availability in Tax Rule grid
  *
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRule $taxRule
  * @param TaxRule $initialTaxRule
  */
 public function processAssert(TaxRuleIndex $taxRuleIndex, TaxRule $taxRule, TaxRule $initialTaxRule = null)
 {
     if ($initialTaxRule !== null) {
         $taxRuleCode = $taxRule->hasData('code') ? $taxRule->getCode() : $initialTaxRule->getCode();
     } else {
         $taxRuleCode = $taxRule->getCode();
     }
     $filter = ['code' => $taxRuleCode];
     $taxRuleIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($taxRuleIndex->getTaxRuleGrid()->isRowVisible($filter), 'Tax Rule \'' . $filter['code'] . '\' is absent in Tax Rule grid.');
 }
コード例 #7
0
 /**
  * Assert that tax rule form filled right
  *
  * @param TaxRuleNew $taxRuleNew
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRule $taxRule
  * @param TaxRule $initialTaxRule
  */
 public function processAssert(TaxRuleNew $taxRuleNew, TaxRuleIndex $taxRuleIndex, TaxRule $taxRule, TaxRule $initialTaxRule = null)
 {
     $data = $taxRule->getData();
     if ($initialTaxRule !== null) {
         $taxRuleCode = $taxRule->hasData('code') ? $taxRule->getCode() : $initialTaxRule->getCode();
     } else {
         $taxRuleCode = $taxRule->getCode();
     }
     $filter = ['code' => $taxRuleCode];
     $taxRuleIndex->open();
     $taxRuleIndex->getTaxRuleGrid()->searchAndOpen($filter);
     $taxRuleNew->getTaxRuleForm()->openAdditionalSettings();
     $formData = $taxRuleNew->getTaxRuleForm()->getData($taxRule);
     $dataDiff = $this->verifyForm($formData, $data);
     \PHPUnit_Framework_Assert::assertTrue(empty($dataDiff), 'Tax Rule form was filled not right.' . "\nLog:\n" . implode(";\n", $dataDiff));
 }
コード例 #8
0
 /**
  * Assert that tax rule not available 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::assertFalse($taxRuleIndex->getTaxRuleGrid()->isRowVisible($filter), 'Tax Rule \'' . $filter['code'] . '\' is present in Tax Rule grid.');
 }