Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
core_fixturestore.php
Go to the documentation of this file.
1 <?php
8 
10 $storeManager = Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class);
11 
13 $store = Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
14 $storeCode = 'fixturestore';
15 
16 if (!$store->load($storeCode)->getId()) {
17  $store->setCode($storeCode)
18  ->setWebsiteId($storeManager->getWebsite()->getId())
19  ->setGroupId($storeManager->getWebsite()->getDefaultGroupId())
20  ->setName('Fixture Store')
21  ->setSortOrder(10)
22  ->setIsActive(1);
23  $store->save();
24 }
25 
26 //if test using this fixture relies on full text functionality it is required to explicitly perform re-indexation
$storeManager