Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerGroupNotOnCartPriceRuleForm.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew;
13 
17 class AssertCustomerGroupNotOnCartPriceRuleForm extends AbstractConstraint
18 {
26  public function processAssert(
27  PromoQuoteNew $promoQuoteNew,
28  CustomerGroup $customerGroup
29  ) {
30  $promoQuoteNew->open();
31  $promoQuoteNew->getSalesRuleForm()->openSection('rule_information');
32 
34  $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getSection('rule_information');
35  \PHPUnit\Framework\Assert::assertFalse(
36  $ruleInformationTab->isVisibleCustomerGroup($customerGroup),
37  "Customer group {$customerGroup->getCustomerGroupCode()} is still in cart price rule page."
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Customer group is not on cart price rule page.';
49  }
50 }