예제 #1
0
파일: filesplugin.php 프로젝트: huemer/hbox
 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');
 }
예제 #2
0
 /**
  * @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');
 }
예제 #3
0
 /**
  * @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');
 }