public function testIsCanDelete() { $websiteCollection = $this->getMock('Magento\\Store\\Model\\ResourceModel\\Website\\Collection', ['getSize'], [], '', false); $websiteCollection->expects($this->any())->method('getSize')->will($this->returnValue(2)); $this->websiteFactory->expects($this->any())->method('create')->willReturn($this->websiteFactory); $this->websiteFactory->expects($this->any())->method('getCollection')->willReturn($websiteCollection); $this->model->setId(2); $this->assertTrue($this->model->isCanDelete()); }
/** * {@inheritdoc} */ public function setId($value) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setId'); if (!$pluginInfo) { return parent::setId($value); } else { return $this->___callPlugins('setId', func_get_args(), $pluginInfo); } }