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()); }