diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-02-25 20:46:01 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-26 09:26:55 +0100 |
commit | 59028cced0a4f7377de9c22012c7624440b14a56 (patch) | |
tree | dc209a35e1626309032640459bec268323e51bac /apps/files_sharing/tests | |
parent | cb41b1a86397579d55e0ce96e67b80a83037d1d2 (diff) | |
download | nextcloud-server-59028cced0a4f7377de9c22012c7624440b14a56.tar.gz nextcloud-server-59028cced0a4f7377de9c22012c7624440b14a56.zip |
Add autodiscovery support to server-to-server sharing
Adds autodiscovery support to server-to-server sharing as specified in the specification. If no discovery data is found it is using the fallback ownCloud endpoints for legacy support.
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/external/managertest.php | 6 | ||||
-rw-r--r-- | apps/files_sharing/tests/server2server.php | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/external/managertest.php index f73fedaf05c..2836a3dc024 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -24,6 +24,7 @@ namespace OCA\Files_Sharing\Tests\External; use OC\Files\Storage\StorageFactory; +use OCA\FederatedFileSharing\DiscoveryManager; use OCA\Files_Sharing\External\Manager; use OCA\Files_Sharing\External\MountProvider; use OCA\Files_Sharing\Tests\TestCase; @@ -64,6 +65,10 @@ class ManagerTest extends TestCase { $this->user = \OC::$server->getUserManager()->get($this->uid); $this->mountManager = new \OC\Files\Mount\Manager(); $this->httpHelper = $httpHelper = $this->getMockBuilder('\OC\HTTPHelper')->disableOriginalConstructor()->getMock(); + $discoveryManager = new DiscoveryManager( + \OC::$server->getMemCacheFactory(), + \OC::$server->getHTTPClientService() + ); /** @var \OC\HTTPHelper $httpHelper */ $this->manager = new Manager( \OC::$server->getDatabaseConnection(), @@ -71,6 +76,7 @@ class ManagerTest extends TestCase { new StorageFactory(), $httpHelper, \OC::$server->getNotificationManager(), + $discoveryManager, $this->uid ); $this->mountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function() { diff --git a/apps/files_sharing/tests/server2server.php b/apps/files_sharing/tests/server2server.php index a282f92ecb9..298f1008f71 100644 --- a/apps/files_sharing/tests/server2server.php +++ b/apps/files_sharing/tests/server2server.php @@ -153,14 +153,19 @@ class Test_Files_Sharing_S2S_OCS_API extends TestCase { function testDeleteUser($toDelete, $expected, $remainingUsers) { $this->createDummyS2SShares(); + $discoveryManager = new \OCA\FederatedFileSharing\DiscoveryManager( + \OC::$server->getMemCacheFactory(), + \OC::$server->getHTTPClientService() + ); $manager = new OCA\Files_Sharing\External\Manager( \OC::$server->getDatabaseConnection(), \OC\Files\Filesystem::getMountManager(), \OC\Files\Filesystem::getLoader(), \OC::$server->getHTTPHelper(), \OC::$server->getNotificationManager(), + $discoveryManager, $toDelete - ); + ); $manager->removeUserShares($toDelete); |