public function testMoveSrcDeletable() { $fileInfoFolderATestTXT = $this->getMockBuilder('\\OCP\\Files\\FileInfo')->disableOriginalConstructor()->getMock(); $fileInfoFolderATestTXT->expects($this->once())->method('isDeletable')->willReturn(true); $this->view->expects($this->once())->method('getFileInfo')->with('FolderA/test.txt')->willReturn($fileInfoFolderATestTXT); $this->plugin->checkMove('FolderA/test.txt', 'test.txt'); }
/** * @expectedException \Sabre\DAV\Exception\NotFound * @expectedExceptionMessage FolderA/test.txt does not exist */ public function testMoveSrcNotExist() { $node = $this->getMockBuilder('\\OCA\\DAV\\Connector\\Sabre\\Node')->disableOriginalConstructor()->getMock(); $node->expects($this->once())->method('getFileInfo')->willReturn(null); $this->tree->expects($this->once())->method('getNodeForPath')->willReturn($node); $this->plugin->checkMove('FolderA/test.txt', 'test.txt'); }
/** * @expectedException \Sabre\DAV\Exception\NotFound * @expectedExceptionMessage FolderA/test.txt does not exist */ public function testMoveSrcNotExist() { $this->view->expects($this->once())->method('getFileInfo')->with('FolderA/test.txt')->willReturn(false); $this->plugin->checkMove('FolderA/test.txt', 'test.txt'); }