Browse Source

Fix tests

tags/v10.0RC1
Lukas Reschke 8 years ago
parent
commit
149218ead9
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php

+ 20
- 0
apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php View File

@@ -35,6 +35,7 @@ class TestDoubleFileView extends \OC\Files\View {
$this->updatables = $updatables;
$this->deletables = $deletables;
$this->canRename = $canRename;
$this->lockingProvider = \OC::$server->getLockingProvider();
}

public function isUpdatable($path) {
@@ -56,6 +57,11 @@ class TestDoubleFileView extends \OC\Files\View {
public function getRelativePath($path) {
return $path;
}

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

/**
@@ -67,6 +73,20 @@ class TestDoubleFileView extends \OC\Files\View {
*/
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

Loading…
Cancel
Save