public function testLoadWebsiteIds() { $websiteIds = [1]; $object = $this->getMockBuilder('Magento\\Framework\\Model\\AbstractModel')->disableOriginalConstructor()->getMock(); $object->expects($this->once())->method('getId')->willReturn(1); $this->adapter->expects($this->once())->method('select')->willReturn($this->select); $this->select->expects($this->once())->method('from')->with('salesrule_website', ['website_id'])->willReturnSelf(); $this->select->expects($this->once())->method('where')->with('rule_id = ?', 1)->willReturnSelf(); $this->adapter->expects($this->once())->method('fetchCol')->with($this->select)->willReturn($websiteIds); $object->expects($this->once())->method('setData')->with('website_ids', $websiteIds); $this->model->loadWebsiteIds($object); }
/** * {@inheritdoc} */ public function loadWebsiteIds(\Magento\Framework\Model\AbstractModel $object) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'loadWebsiteIds'); if (!$pluginInfo) { return parent::loadWebsiteIds($object); } else { return $this->___callPlugins('loadWebsiteIds', func_get_args(), $pluginInfo); } }