Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCatalogPriceRuleNotInGrid.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\CatalogRule\Test\Fixture\CatalogRule;
10 use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertCatalogPriceRuleNotInGrid extends AbstractConstraint
17 {
25  public function processAssert(
26  CatalogRule $catalogPriceRule,
27  CatalogRuleIndex $pageCatalogRuleIndex
28  ) {
29  $filter = [
30  'rule_id' => $catalogPriceRule->getId(),
31  'name' => $catalogPriceRule->getName(),
32  ];
33  $pageCatalogRuleIndex->open();
34  \PHPUnit\Framework\Assert::assertFalse(
35  $pageCatalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter),
36  'Catalog Price Rule \'' . $filter['rule_id'] . '\', '
37  . 'with name \'' . $filter['name'] . '\', '
38  . 'is present in Catalog Price Rule grid.'
39  );
40  }
41 
47  public function toString()
48  {
49  return 'Catalog Price Rule is NOT present in Catalog Rule grid.';
50  }
51 }
processAssert(CatalogRule $catalogPriceRule, CatalogRuleIndex $pageCatalogRuleIndex)