Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteCategoryEntityTest.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 
31 class DeleteCategoryEntityTest extends Injectable
32 {
33  /* tags */
34  const MVP = 'yes';
35  /* end tags */
36 
43 
50 
58  public function __inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)
59  {
60  $this->catalogCategoryIndex = $catalogCategoryIndex;
61  $this->catalogCategoryEdit = $catalogCategoryEdit;
62  }
63 
70  public function test(Category $category)
71  {
72  $category->persist();
73  $this->catalogCategoryIndex->open();
74  $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
75  if ($this->catalogCategoryEdit->getFormPageActions()->checkDeleteButton()) {
76  $this->catalogCategoryEdit->getFormPageActions()->delete();
77  $this->catalogCategoryEdit->getModalBlock()->acceptAlert();
78  }
79  }
80 }
__inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)