summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-09 10:04:56 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-09 10:04:56 +0100
commitbc744ff6debe5f812b3c4a32f56b133b3cb3c145 (patch)
treebfd74101cc806c56bfe2f0c1d5c2ced5b6849328 /tests/lib
parent6ba22f0243b8d0f33a4c2b7e56bae5b971614d02 (diff)
parentd0cca6c3aded2aaa35e5b2caab46ff49676eecbd (diff)
downloadnextcloud-server-bc744ff6debe5f812b3c4a32f56b133b3cb3c145.tar.gz
nextcloud-server-bc744ff6debe5f812b3c4a32f56b133b3cb3c145.zip
Merge pull request #21038 from owncloud/share-computesharepermissions-notstore
Fix (re)share permission checks in a few code paths
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/node/file.php10
-rw-r--r--tests/lib/files/node/folder.php10
-rw-r--r--tests/lib/files/node/node.php10
3 files changed, 27 insertions, 3 deletions
diff --git a/tests/lib/files/node/file.php b/tests/lib/files/node/file.php
index d0072949c7f..ccc777c499f 100644
--- a/tests/lib/files/node/file.php
+++ b/tests/lib/files/node/file.php
@@ -21,8 +21,16 @@ class File extends \Test\TestCase {
$this->user = new \OC\User\User('', new \Test\Util\User\Dummy);
}
+ protected function getMockStorage() {
+ $storage = $this->getMock('\OCP\Files\Storage');
+ $storage->expects($this->any())
+ ->method('getId')
+ ->will($this->returnValue('home::someuser'));
+ return $storage;
+ }
+
protected function getFileInfo($data) {
- return new FileInfo('', null, '', $data, null);
+ return new FileInfo('', $this->getMockStorage(), '', $data, null);
}
public function testDelete() {
diff --git a/tests/lib/files/node/folder.php b/tests/lib/files/node/folder.php
index d95e1b5d2b2..09bf32561e6 100644
--- a/tests/lib/files/node/folder.php
+++ b/tests/lib/files/node/folder.php
@@ -31,8 +31,16 @@ class Folder extends \Test\TestCase {
$this->user = new \OC\User\User('', new \Test\Util\User\Dummy);
}
+ protected function getMockStorage() {
+ $storage = $this->getMock('\OCP\Files\Storage');
+ $storage->expects($this->any())
+ ->method('getId')
+ ->will($this->returnValue('home::someuser'));
+ return $storage;
+ }
+
protected function getFileInfo($data) {
- return new FileInfo('', null, '', $data, null);
+ return new FileInfo('', $this->getMockStorage(), '', $data, null);
}
public function testDelete() {
diff --git a/tests/lib/files/node/node.php b/tests/lib/files/node/node.php
index afcf4cbabaa..a1693b034fa 100644
--- a/tests/lib/files/node/node.php
+++ b/tests/lib/files/node/node.php
@@ -18,8 +18,16 @@ class Node extends \Test\TestCase {
$this->user = new \OC\User\User('', new \Test\Util\User\Dummy);
}
+ protected function getMockStorage() {
+ $storage = $this->getMock('\OCP\Files\Storage');
+ $storage->expects($this->any())
+ ->method('getId')
+ ->will($this->returnValue('home::someuser'));
+ return $storage;
+ }
+
protected function getFileInfo($data) {
- return new FileInfo('', null, '', $data, null);
+ return new FileInfo('', $this->getMockStorage(), '', $data, null);
}
public function testStat() {