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 isCanDelete() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isCanDelete'); if (!$pluginInfo) { return parent::isCanDelete(); } else { return $this->___callPlugins('isCanDelete', func_get_args(), $pluginInfo); } }
public function testIsCanDelete() { $this->assertFalse($this->_model->isCanDelete()); $this->_model->isReadOnly(true); $this->assertFalse($this->_model->isCanDelete()); }