Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertTaxRateInTaxRule.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Tax\Test\Fixture\TaxRate;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew;
12 use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
13 
17 class AssertTaxRateInTaxRule extends AbstractConstraint
18 {
27  public function processAssert(TaxRuleIndex $taxRuleIndex, TaxRuleNew $taxRuleNew, TaxRate $taxRate)
28  {
29  $taxRateCode = $taxRate->getCode();
30  $taxRuleIndex->open();
31  $taxRuleIndex->getGridPageActions()->addNew();
32 
33  \PHPUnit\Framework\Assert::assertTrue(
34  $taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxRateCode),
35  "$taxRateCode is not present in Tax Rates multiselect on tax rule creation page."
36  );
37  }
38 
44  public function toString()
45  {
46  return "Required tax rate is present on Tax Rule page.";
47  }
48 }
processAssert(TaxRuleIndex $taxRuleIndex, TaxRuleNew $taxRuleNew, TaxRate $taxRate)
$taxRate
Definition: tax_rule.php:12