Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeIsGlobal.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertProductAttributeIsGlobal extends AbstractConstraint
17 {
25  public function processAssert(
26  CatalogProductAttributeIndex $catalogProductAttributeIndex,
27  CatalogProductAttribute $attribute
28  ) {
29  $filter = ['frontend_label' => $attribute->getFrontendLabel(), 'is_global' => $attribute->getIsGlobal()];
30 
31  \PHPUnit\Framework\Assert::assertTrue(
32  $catalogProductAttributeIndex->open()->getGrid()->isRowVisible($filter),
33  'Attribute is not global.'
34  );
35  }
36 
42  public function toString()
43  {
44  return 'Attribute is global.';
45  }
46 }
processAssert(CatalogProductAttributeIndex $catalogProductAttributeIndex, CatalogProductAttribute $attribute)