summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-06-30 14:41:23 +0200
committerGitHub <noreply@github.com>2016-06-30 14:41:23 +0200
commit8e002b61554308cb4d50570f715303a82136f0fa (patch)
treefa27987626d305fcc73170650d3ef6cfaedd7720 /apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
parent2cdee70305d72ea018f5bccdcc8d62c159204ef9 (diff)
parent26e14529be942e3cc3c2bb2b388b155073daecb1 (diff)
downloadnextcloud-server-8e002b61554308cb4d50570f715303a82136f0fa.tar.gz
nextcloud-server-8e002b61554308cb4d50570f715303a82136f0fa.zip
Merge pull request #255 from nextcloud/dav-permission-check
add some additonal permission checks to the webdav backend
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
index 4a5e43376c0..96d4357660e 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
@@ -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