Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeAbsenceInTemplateGroups.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetEdit;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
18 class AssertProductAttributeAbsenceInTemplateGroups extends AbstractConstraint
19 {
28  public function processAssert(
29  CatalogAttributeSet $attributeSet,
30  CatalogProductSetIndex $productSetIndex,
31  CatalogProductSetEdit $productSetEdit
32  ) {
33  $filter = ['set_name' => $attributeSet->getAttributeSetName()];
34  $productSetIndex->open();
35  $productSetIndex->getGrid()->searchAndOpen($filter);
36 
38  ->getDataFieldConfig('assigned_attributes')['source']
39  ->getAttributes()[0]
40  ->getAttributeCode();
41 
42  \PHPUnit\Framework\Assert::assertFalse(
43  $productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeCode),
44  "Attribute " . $attributeCode . " is present in Attribute set's Groups section."
45  );
46  }
47 
53  public function toString()
54  {
55  return "Product Attribute is absent in Attribute set's Groups section.";
56  }
57 }
processAssert(CatalogAttributeSet $attributeSet, CatalogProductSetIndex $productSetIndex, CatalogProductSetEdit $productSetEdit)
$attributeCode
Definition: extend.phtml:12