summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-02 10:38:39 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-09-06 09:29:27 +0200
commitc629761fea1be21be1cef7fdfd8673a45d3244c3 (patch)
tree17a6a381b4ca4eef0248a5d706fe57a03e4a64fc /apps/files_sharing
parentd13ac20bca932fdcccb1f88f68b35d61aa6871a9 (diff)
downloadnextcloud-server-c629761fea1be21be1cef7fdfd8673a45d3244c3.tar.gz
nextcloud-server-c629761fea1be21be1cef7fdfd8673a45d3244c3.zip
Fix getMock files_sharing
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/MountProviderTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php
index 576f05d565d..0be74a645a9 100644
--- a/apps/files_sharing/tests/MountProviderTest.php
+++ b/apps/files_sharing/tests/MountProviderTest.php
@@ -25,10 +25,12 @@
namespace OCA\Files_Sharing\Tests;
use OCA\Files_Sharing\MountProvider;
+use OCP\Files\IRootFolder;
use OCP\Files\Storage\IStorageFactory;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IUser;
+use OCP\IUserManager;
use OCP\Share\IShare;
use OCP\Share\IManager;
use OCP\Files\Mount\IMountPoint;
@@ -69,7 +71,7 @@ class MountProviderTest extends \Test\TestCase {
}
private function makeMockShare($id, $nodeId, $owner = 'user2', $target = null, $permissions = 31) {
- $share = $this->getMock('\OCP\Share\IShare');
+ $share = $this->createMock(IShare::class);
$share->expects($this->any())
->method('getPermissions')
->will($this->returnValue($permissions));
@@ -100,8 +102,8 @@ class MountProviderTest extends \Test\TestCase {
* - shares with a group in which the owner is already in
*/
public function testExcludeShares() {
- $rootFolder = $this->getMock('\OCP\Files\IRootFolder');
- $userManager = $this->getMock('\OCP\IUserManager');
+ $rootFolder = $this->createMock(IRootFolder::class);
+ $userManager = $this->createMock(IUserManager::class);
$userShares = [
$this->makeMockShare(1, 100, 'user2', '/share2', 0),
$this->makeMockShare(2, 100, 'user2', '/share2', 31),
@@ -277,8 +279,8 @@ class MountProviderTest extends \Test\TestCase {
* @param array $expectedShares array of expected supershare specs
*/
public function testMergeShares($userShares, $groupShares, $expectedShares) {
- $rootFolder = $this->getMock('\OCP\Files\IRootFolder');
- $userManager = $this->getMock('\OCP\IUserManager');
+ $rootFolder = $this->createMock(IRootFolder::class);
+ $userManager = $this->createMock(IUserManager::class);
$userShares = array_map(function($shareSpec) {
return $this->makeMockShare($shareSpec[0], $shareSpec[1], $shareSpec[2], $shareSpec[3], $shareSpec[4]);