コード例 #1
0
 /**
  * Create Tax Rate Entity test.
  *
  * @param TaxRate $taxRate
  * @return void
  */
 public function testCreateTaxRate(TaxRate $taxRate)
 {
     // Steps
     $this->taxRateIndexPage->open();
     $this->taxRateIndexPage->getGridPageActions()->addNew();
     $this->taxRateNewPage->getTaxRateForm()->fill($taxRate);
     $this->taxRateNewPage->getFormPageActions()->save();
 }
コード例 #2
0
 /**
  * Assert that tax rate form filled correctly
  *
  * @param TaxRateIndex $taxRateIndexPage
  * @param TaxRateNew $taxRateNewPage
  * @param TaxRate $taxRate
  * @param TaxRate $initialTaxRate
  * @return void
  */
 public function processAssert(TaxRateIndex $taxRateIndexPage, TaxRateNew $taxRateNewPage, TaxRate $taxRate, TaxRate $initialTaxRate = null)
 {
     $data = $this->prepareData($taxRate, $initialTaxRate);
     $filter = ['code' => $data['code']];
     $taxRateIndexPage->open();
     $taxRateIndexPage->getTaxRateGrid()->searchAndOpen($filter);
     $formData = $taxRateNewPage->getTaxRateForm()->getData($taxRate);
     $dataDiff = $this->verifyForm($formData, $data);
     \PHPUnit_Framework_Assert::assertTrue(empty($dataDiff), 'Tax Rate form was filled incorrectly.' . "\nLog:\n" . implode(";\n", $dataDiff));
 }
コード例 #3
0
 /**
  * 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();
 }
コード例 #4
0
 /**
  * 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();
 }