Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertAdvancedSearchAttributeIsAbsent.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
10 use Magento\CatalogSearch\Test\Page\AdvancedSearch;
11 use Magento\Mtf\Constraint\AbstractConstraint;
13 
17 class AssertAdvancedSearchAttributeIsAbsent extends AbstractConstraint
18 {
27  public function processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch, Indexer $cli)
28  {
29  $cli->reindex();
30  $advancedSearch->open();
31  $formLabels = $advancedSearch->getForm()->getFormLabels();
32  $label = $attribute->hasData('manage_frontend_label')
33  ? $attribute->getManageFrontendLabel()
34  : $attribute->getFrontendLabel();
35  \PHPUnit\Framework\Assert::assertFalse(
36  in_array($label, $formLabels),
37  'Created custom product attribute is present in advanced search form on frontend but must be absent.'
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Created custom product attribute is absent in advanced search form on frontend.';
49  }
50 }
processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch, Indexer $cli)
$label
Definition: details.phtml:21