/** * @covers \Magento\Store\Model\Website::setGroups * @covers \Magento\Store\Model\Website::setStores * @covers \Magento\Store\Model\Website::getStores */ public function testSetGroupsAndStores() { /* Groups */ $expectedGroup = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Store\\Model\\Group'); $expectedGroup->setId(123); $this->_model->setDefaultGroupId($expectedGroup->getId()); $this->_model->setGroups(array($expectedGroup)); $groups = $this->_model->getGroups(); $this->assertSame($expectedGroup, reset($groups)); /* Stores */ $expectedStore = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Store\\Model\\Store'); $expectedStore->setId(456); $expectedGroup->setDefaultStoreId($expectedStore->getId()); $this->_model->setStores(array($expectedStore)); $stores = $this->_model->getStores(); $this->assertSame($expectedStore, reset($stores)); }
/** * {@inheritdoc} */ public function setStores($stores) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setStores'); if (!$pluginInfo) { return parent::setStores($stores); } else { return $this->___callPlugins('setStores', func_get_args(), $pluginInfo); } }