summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-05 11:42:54 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-06 14:53:43 +0100
commit527b434cd270b46bd47559760023385ba83024ba (patch)
tree6027123f3c68dc321a9bedc3ad11cbb95d8bea16 /apps/files_sharing/tests
parent0ab227310f3519dc2805b80518ad91923bc4dc1f (diff)
downloadnextcloud-server-527b434cd270b46bd47559760023385ba83024ba.tar.gz
nextcloud-server-527b434cd270b46bd47559760023385ba83024ba.zip
[Sharing 2.0] Do not use static function to get numeric storage id
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/api/share20ocstest.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/api/share20ocstest.php
index 2d69636541e..74a5d0752a4 100644
--- a/apps/files_sharing/tests/api/share20ocstest.php
+++ b/apps/files_sharing/tests/api/share20ocstest.php
@@ -172,8 +172,18 @@ class Share20OCSTest extends \Test\TestCase {
$group = $this->getMock('OCP\IGroup');
$group->method('getGID')->willReturn('groupId');
- $storage = $this->getMock('OCP\Files\Storage');
+ $cache = $this->getMockBuilder('OC\Files\Cache\Cache')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $cache->method('getNumericStorageId')->willReturn(101);
+
+ $storage = $this->getMockBuilder('OC\Files\Storage\Storage')
+ ->disableOriginalConstructor()
+ ->getMock();
$storage->method('getId')->willReturn('STORAGE');
+ $storage->method('getCache')->willReturn($cache);
+
+
$parentFolder = $this->getMock('OCP\Files\Folder');
$parentFolder->method('getId')->willReturn(3);
@@ -224,7 +234,7 @@ class Share20OCSTest extends \Test\TestCase {
'parent' => 6,
'storage_id' => 'STORAGE',
'path' => 'file',
- 'storage' => null, // HACK around static function
+ 'storage' => 101,
'mail_send' => 0,
];
$data[] = [$share, $expected];
@@ -263,7 +273,7 @@ class Share20OCSTest extends \Test\TestCase {
'parent' => 6,
'storage_id' => 'STORAGE',
'path' => 'folder',
- 'storage' => null, // HACK around static function
+ 'storage' => 101,
'mail_send' => 0,
];
$data[] = [$share, $expected];
@@ -305,7 +315,7 @@ class Share20OCSTest extends \Test\TestCase {
'parent' => 6,
'storage_id' => 'STORAGE',
'path' => 'folder',
- 'storage' => null, // HACK around static function
+ 'storage' => 101,
'mail_send' => 0,
'url' => 'url',
];