10 use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
11 use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew;
12 use Magento\Mtf\Constraint\AbstractConstraint;
28 TaxRuleNew $taxRuleNew,
29 TaxRuleIndex $taxRuleIndex,
31 TaxRule $initialTaxRule =
null 34 if ($initialTaxRule !==
null) {
35 $taxRuleCode = (
$taxRule->hasData(
'code')) ?
$taxRule->getCode() : $initialTaxRule->getCode();
40 'code' => $taxRuleCode,
42 $taxRuleIndex->open();
43 $taxRuleIndex->getTaxRuleGrid()->searchAndOpen($filter);
44 $taxRuleNew->getTaxRuleForm()->openAdditionalSettings();
45 $formData = $taxRuleNew->getTaxRuleForm()->getData(
$taxRule);
47 \PHPUnit\Framework\Assert::assertTrue(
49 'Tax Rule form was filled not right.' 50 .
"\nLog:\n" . implode(
";\n", $dataDiff)
61 protected function verifyForm(array $formData, array $fixtureData)
65 foreach ($fixtureData as $key =>
$value) {
67 $diff = array_diff(
$value, $formData[$key]);
68 $diff = array_merge($diff, array_diff($formData[$key],
$value));
70 $errorMessage[] =
"Data in " . $key .
" field not equal." 71 .
"\nExpected: " . implode(
", ",
$value)
72 .
"\nActual: " . implode(
", ", $formData[$key]);
75 if (
$value !== $formData[$key]) {
76 $errorMessage[] =
"Data in " . $key .
" field not equal." 78 .
"\nActual: " . $formData[$key];
93 return 'Tax Rule form has been filled right.';