Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateCategoryEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryEdit;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryIndex;
12 use Magento\Mtf\TestCase\Injectable;
13 
28 class CreateCategoryEntityTest extends Injectable
29 {
30  /* tags */
31  const MVP = 'yes';
32  const TEST_TYPE = 'acceptance_test, extended_acceptance_test';
33  /* end tags */
34 
41 
48 
56  public function __inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)
57  {
58  $this->catalogCategoryIndex = $catalogCategoryIndex;
59  $this->catalogCategoryEdit = $catalogCategoryEdit;
60  }
61 
69  public function test(Category $category, $addCategory)
70  {
71  $this->catalogCategoryIndex->open();
72  $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category, false);
73  $this->catalogCategoryIndex->getTreeCategories()->$addCategory();
74  $this->catalogCategoryEdit->getEditForm()->fill($category);
75  $this->catalogCategoryEdit->getFormPageActions()->save();
76  }
77 }
__inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)