Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateAttributeSetEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetAdd;
12 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetEdit;
13 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex;
14 use Magento\Mtf\TestCase\Injectable;
15 
31 class CreateAttributeSetEntityTest extends Injectable
32 {
33  /* tags */
34  const MVP = 'yes';
35  /* end tags */
36 
42  protected $productSetIndex;
43 
49  protected $productSetAdd;
50 
56  protected $productSetEdit;
57 
64  public function __inject(
65  CatalogProductSetIndex $productSetIndex,
66  CatalogProductSetAdd $productSetAdd,
67  CatalogProductSetEdit $productSetEdit
68  ) {
69  $this->productSetIndex = $productSetIndex;
70  $this->productSetAdd = $productSetAdd;
71  $this->productSetEdit = $productSetEdit;
72  }
73 
81  public function testCreateAttributeSet(
82  CatalogAttributeSet $attributeSet,
83  CatalogProductAttribute $productAttribute
84  ) {
85  $productAttribute->persist();
86 
87  //Steps
88  $this->productSetIndex->open();
89  $this->productSetIndex->getPageActionsBlock()->addNew();
90 
91  $this->productSetAdd->getAttributeSetForm()->fill($attributeSet);
92  $this->productSetAdd->getPageActions()->save();
93  $this->productSetEdit->getAttributeSetEditBlock()->moveAttribute($productAttribute->getData());
94  $this->productSetEdit->getPageActions()->save();
95  }
96 }
__inject(CatalogProductSetIndex $productSetIndex, CatalogProductSetAdd $productSetAdd, CatalogProductSetEdit $productSetEdit)
testCreateAttributeSet(CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute)