diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-10-20 17:32:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 17:32:10 +0200 |
commit | 1021c894542a778948bfddb9722e10dddf91f4b8 (patch) | |
tree | fb46c686870b5bbe7bd219f97583b1c494e158a9 /apps/files_sharing/tests | |
parent | b98f3f31de6aea76f93cae1f8120ac6e404e2c34 (diff) | |
parent | 033a83b0ace2dd12be7329c458a93e89da0ca207 (diff) | |
download | nextcloud-server-1021c894542a778948bfddb9722e10dddf91f4b8.tar.gz nextcloud-server-1021c894542a778948bfddb9722e10dddf91f4b8.zip |
Merge pull request #28314 from nextcloud/sharing-ibootstrap
move files_sharing to IBootStrap
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/External/ManagerTest.php | 11 | ||||
-rw-r--r-- | apps/files_sharing/tests/TestCase.php | 10 |
2 files changed, 19 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 335425b7a12..ab7c682c3a6 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -44,7 +44,9 @@ use OCP\Http\Client\IResponse; use OCP\IGroup; use OCP\IGroupManager; use OCP\IURLGenerator; +use OCP\IUser; use OCP\IUserManager; +use OCP\IUserSession; use OCP\Share\IShare; use Psr\Log\LoggerInterface; use Test\Traits\UserTrait; @@ -153,6 +155,13 @@ class ManagerTest extends TestCase { } private function createManagerForUser($userId) { + $user = $this->createMock(IUser::class); + $user->method('getUID') + ->willReturn($userId); + $userSession = $this->createMock(IUserSession::class); + $userSession->method('getUser') + ->willReturn($user); + return $this->getMockBuilder(Manager::class) ->setConstructorArgs( [ @@ -166,7 +175,7 @@ class ManagerTest extends TestCase { $this->cloudFederationFactory, $this->groupManager, $this->userManager, - $userId, + $userSession, $this->eventDispatcher, $this->logger, ] diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index 54c8704df81..bb1e3125ab2 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -34,6 +34,9 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; use OCA\Files_Sharing\AppInfo\Application; +use OCA\Files_Sharing\External\MountProvider as ExternalMountProvider; +use OCA\Files_Sharing\MountProvider; +use OCP\Files\Config\IMountProviderCollection; use OCP\Share\IShare; use Test\Traits\MountProviderTrait; @@ -71,7 +74,12 @@ abstract class TestCase extends \Test\TestCase { public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - new Application(); + $app = new Application(); + $app->registerMountProviders( + \OC::$server->get(IMountProviderCollection::class), + \OC::$server->get(MountProvider::class), + \OC::$server->get(ExternalMountProvider::class), + ); // reset backend \OC_User::clearBackends(); |