diff options
author | Robin Appelman <robin@icewind.nl> | 2022-02-23 18:29:08 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-03-04 16:29:59 +0100 |
commit | 1c468129afa2b2ec4a370a879f8eaffd22768baf (patch) | |
tree | 1c096e8c0a62371965104684e1f1bf2ef55eb2d4 /apps/files_sharing/tests | |
parent | 5c0fe934988960ece3ac71d5a1dfc8df405413aa (diff) | |
download | nextcloud-server-1c468129afa2b2ec4a370a879f8eaffd22768baf.tar.gz nextcloud-server-1c468129afa2b2ec4a370a879f8eaffd22768baf.zip |
adjust tests to new fs setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/External/ManagerTest.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index ab7c682c3a6..30c96ebad6a 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -31,14 +31,18 @@ namespace OCA\Files_Sharing\Tests\External; use OC\Federation\CloudIdManager; +use OC\Files\SetupManager; use OC\Files\Storage\StorageFactory; use OCA\Files_Sharing\External\Manager; use OCA\Files_Sharing\External\MountProvider; use OCA\Files_Sharing\Tests\TestCase; use OCP\Contacts\IManager; +use OCP\Diagnostics\IEventLogger; use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; +use OCP\Files\Config\IMountProviderCollection; +use OCP\Files\NotFoundException; use OCP\Http\Client\IClientService; use OCP\Http\Client\IResponse; use OCP\IGroup; @@ -102,9 +106,13 @@ class ManagerTest extends TestCase { parent::setUp(); $this->uid = $this->getUniqueID('user'); - $this->createUser($this->uid, ''); - $this->user = \OC::$server->getUserManager()->get($this->uid); - $this->mountManager = new \OC\Files\Mount\Manager(); + $this->user = $this->createUser($this->uid, ''); + $this->mountManager = new \OC\Files\Mount\Manager( + $this->createMock(IEventLogger::class), + $this->createMock(IMountProviderCollection::class), + $this->createMock(IUserSession::class), + $this->createMock(IEventDispatcher::class) + ); $this->clientService = $this->getMockBuilder(IClientService::class) ->disableOriginalConstructor()->getMock(); $this->cloudFederationProviderManager = $this->createMock(ICloudFederationProviderManager::class); @@ -740,12 +748,12 @@ class ManagerTest extends TestCase { private function assertNotMount($mountPoint) { $mountPoint = rtrim($mountPoint, '/'); - $mount = $this->mountManager->find($this->getFullPath($mountPoint)); - if ($mount) { + try { + $mount = $this->mountManager->find($this->getFullPath($mountPoint)); $this->assertInstanceOf('\OCP\Files\Mount\IMountPoint', $mount); $this->assertNotEquals($this->getFullPath($mountPoint), rtrim($mount->getMountPoint(), '/')); - } else { - $this->assertNull($mount); + } catch (NotFoundException $e) { + } } |