summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-12-08 16:33:39 +0100
committerVincent Petry <pvince81@owncloud.com>2015-12-08 16:33:39 +0100
commit28e9bc115615aab6c951fb846b8bd28aa517331e (patch)
tree364ad8e29f61b3be4583db1130c29317d05619c1 /tests
parent6e4006d1397817f83c2dd3cafc4d697ac1e6a2a7 (diff)
downloadnextcloud-server-28e9bc115615aab6c951fb846b8bd28aa517331e.tar.gz
nextcloud-server-28e9bc115615aab6c951fb846b8bd28aa517331e.zip
Fix more unit tests to pass a mock storage instead of null to FileInfo
Diffstat (limited to 'tests')
-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() {