diff options
author | Robin Appelman <robin@icewind.nl> | 2017-01-27 12:52:17 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-02-08 15:17:02 +0100 |
commit | fa49c4a13b6c5455b13ad44cfc158b271aa9b616 (patch) | |
tree | 1014b6de1bd3761e2e26467c78c6f5fd4697ea56 /apps/files_sharing/tests/External | |
parent | 1a591cea97313b8500154d6c2c9ce3aaf2f38a88 (diff) | |
download | nextcloud-server-fa49c4a13b6c5455b13ad44cfc158b271aa9b616.tar.gz nextcloud-server-fa49c4a13b6c5455b13ad44cfc158b271aa9b616.zip |
Add a single public api for resolving a cloud id to a user and remote and back
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/tests/External')
-rw-r--r-- | apps/files_sharing/tests/External/CacheTest.php | 9 | ||||
-rw-r--r-- | apps/files_sharing/tests/External/ManagerTest.php | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php index a31a748a69b..0129e760648 100644 --- a/apps/files_sharing/tests/External/CacheTest.php +++ b/apps/files_sharing/tests/External/CacheTest.php @@ -24,7 +24,9 @@ */ namespace OCA\Files_Sharing\Tests\External; +use OC\Federation\CloudIdManager; use OCA\Files_Sharing\Tests\TestCase; +use OCP\Federation\ICloudIdManager; /** * Class Cache @@ -50,9 +52,13 @@ class CacheTest extends TestCase { */ private $remoteUser; + /** @var ICloudIdManager */ + private $cloudIdManager; + protected function setUp() { parent::setUp(); + $this->cloudIdManager = new CloudIdManager(); $this->remoteUser = $this->getUniqueID('remoteuser'); $this->storage = $this->getMockBuilder('\OCA\Files_Sharing\External\Storage') @@ -64,8 +70,7 @@ class CacheTest extends TestCase { ->will($this->returnValue('dummystorage::')); $this->cache = new \OCA\Files_Sharing\External\Cache( $this->storage, - 'http://example.com/owncloud', - $this->remoteUser + $this->cloudIdManager->getCloudId($this->remoteUser, 'http://example.com/owncloud') ); $this->cache->put( 'test.txt', diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 48476888bdd..f2a55babcc7 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -25,6 +25,7 @@ namespace OCA\Files_Sharing\Tests\External; +use OC\Federation\CloudIdManager; use OC\Files\Storage\StorageFactory; use OCA\FederatedFileSharing\DiscoveryManager; use OCA\Files_Sharing\External\Manager; @@ -84,7 +85,7 @@ class ManagerTest extends TestCase { ); $this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function() { return $this->manager; - }); + }, new CloudIdManager()); } private function setupMounts() { |