Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
LukasReschke committed Jun 30, 2016
commit ea18d86566939229604825ab1b147643db67f55e
20 changes: 20 additions & 0 deletions apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct($updatables, $deletables, $canRename = true) {
$this->updatables = $updatables;
$this->deletables = $deletables;
$this->canRename = $canRename;
$this->lockingProvider = \OC::$server->getLockingProvider();
}

public function isUpdatable($path) {
Expand All @@ -56,6 +57,11 @@ public function rename($path1, $path2) {
public function getRelativePath($path) {
return $path;
}

public function getFileInfo($path, $includeMountPoints = true) {
$objectTreeTest = new ObjectTreeTest();
return $objectTreeTest->getFileInfoMock();
}
}

/**
Expand All @@ -67,6 +73,20 @@ public function getRelativePath($path) {
*/
class ObjectTreeTest extends \Test\TestCase {

public function getFileInfoMock() {
$mock = $this->getMock('\OCP\Files\FileInfo');
$mock
->expects($this->any())
->method('isDeletable')
->willReturn(true);
$mock
->expects($this->any())
->method('isUpdateable')
->willReturn(true);

return $mock;
}

/**
* @dataProvider moveFailedProvider
* @expectedException \Sabre\DAV\Exception\Forbidden
Expand Down