Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractCmsBlockEntityTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Backend\Test\Page\Adminhtml\StoreDelete;
10 use Magento\Backend\Test\Page\Adminhtml\StoreIndex;
11 use Magento\Backend\Test\Page\Adminhtml\StoreNew;
12 use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex;
13 use Magento\Cms\Test\Page\Adminhtml\CmsBlockNew;
14 use Magento\Mtf\TestCase\Injectable;
15 
19 abstract class AbstractCmsBlockEntityTest extends Injectable
20 {
26  protected $cmsBlockIndex;
27 
33  protected $cmsBlockNew;
34 
40  protected $storeIndex;
41 
47  protected $storeNew;
48 
54  protected $storeDelete;
55 
61  protected $storeName;
62 
68  protected $skippedStores = [
69  'All Store Views',
70  'Main Website/Main Website Store/Default Store View',
71  ];
72 
83  public function __inject(
84  CmsBlockIndex $cmsBlockIndex,
85  CmsBlockNew $cmsBlockNew,
86  StoreIndex $storeIndex,
87  StoreNew $storeNew,
88  StoreDelete $storeDelete
89  ) {
90  $this->cmsBlockIndex = $cmsBlockIndex;
91  $this->cmsBlockNew = $cmsBlockNew;
92  $this->storeIndex = $storeIndex;
93  $this->storeNew = $storeNew;
94  $this->storeDelete = $storeDelete;
95  }
96 
102  public function tearDown()
103  {
104  foreach ($this->storeName as $store) {
105  if (in_array($store, $this->skippedStores)) {
106  continue;
107  }
108  $tmp = explode("/", $store);
109  $filter['store_title'] = end($tmp);
110  $this->storeIndex->open();
111  $this->storeIndex->getStoreGrid()->searchAndOpen($filter);
112  $this->storeNew->getFormPageActions()->delete();
113  $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']);
114  $this->storeDelete->getFormPageActions()->delete();
115  }
116  }
117 }
__inject(CmsBlockIndex $cmsBlockIndex, CmsBlockNew $cmsBlockNew, StoreIndex $storeIndex, StoreNew $storeNew, StoreDelete $storeDelete)