aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests/Controller
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-01-27 12:52:17 +0100
committerRobin Appelman <robin@icewind.nl>2017-02-08 15:17:02 +0100
commitfa49c4a13b6c5455b13ad44cfc158b271aa9b616 (patch)
tree1014b6de1bd3761e2e26467c78c6f5fd4697ea56 /apps/federatedfilesharing/tests/Controller
parent1a591cea97313b8500154d6c2c9ce3aaf2f38a88 (diff)
downloadnextcloud-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/federatedfilesharing/tests/Controller')
-rw-r--r--apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php9
-rw-r--r--apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php13
2 files changed, 19 insertions, 3 deletions
diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
index bd091bed410..7714ff4731c 100644
--- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
@@ -25,11 +25,13 @@
namespace OCA\FederatedFileSharing\Tests\Controller;
+use OC\Federation\CloudIdManager;
use OC\HintException;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\Controller\MountPublicLinkController;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCP\AppFramework\Http;
+use OCP\Federation\ICloudIdManager;
use OCP\Files\IRootFolder;
use OCP\Http\Client\IClientService;
use OCP\IL10N;
@@ -77,6 +79,9 @@ class MountPublicLinkControllerTest extends \Test\TestCase {
/** @var IShare */
private $share;
+ /** @var ICloudIdManager */
+ private $cloudIdManager;
+
public function setUp() {
parent::setUp();
@@ -93,6 +98,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase {
$this->l10n = $this->getMockBuilder('OCP\IL10N')->disableOriginalConstructor()->getMock();
$this->userSession = $this->getMockBuilder('OCP\IUserSession')->disableOriginalConstructor()->getMock();
$this->clientService = $this->getMockBuilder('OCP\Http\Client\IClientService')->disableOriginalConstructor()->getMock();
+ $this->cloudIdManager = new CloudIdManager();
$this->controller = new MountPublicLinkController(
'federatedfilesharing', $this->request,
@@ -102,7 +108,8 @@ class MountPublicLinkControllerTest extends \Test\TestCase {
$this->session,
$this->l10n,
$this->userSession,
- $this->clientService
+ $this->clientService,
+ $this->cloudIdManager
);
}
diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
index 18d698d398e..61f87e9ec67 100644
--- a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
@@ -27,10 +27,12 @@
namespace OCA\FederatedFileSharing\Tests;
+use OC\Federation\CloudIdManager;
use OC\Files\Filesystem;
use OCA\FederatedFileSharing\DiscoveryManager;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\FederatedFileSharing\Controller\RequestHandlerController;
+use OCP\Federation\ICloudIdManager;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
@@ -72,6 +74,9 @@ class RequestHandlerControllerTest extends TestCase {
/** @var IShare|\PHPUnit_Framework_MockObject_MockObject */
private $share;
+ /** @var ICloudIdManager */
+ private $cloudIdManager;
+
protected function setUp() {
parent::setUp();
@@ -100,6 +105,8 @@ class RequestHandlerControllerTest extends TestCase {
$this->addressHandler = $this->getMockBuilder('OCA\FederatedFileSharing\AddressHandler')
->disableOriginalConstructor()->getMock();
$this->userManager = $this->getMockBuilder('OCP\IUserManager')->getMock();
+
+ $this->cloudIdManager = new CloudIdManager();
$this->registerHttpHelper($httpHelperMock);
@@ -111,7 +118,8 @@ class RequestHandlerControllerTest extends TestCase {
\OC::$server->getShareManager(),
$this->notifications,
$this->addressHandler,
- $this->userManager
+ $this->userManager,
+ $this->cloudIdManager
);
$this->connection = \OC::$server->getDatabaseConnection();
@@ -190,7 +198,8 @@ class RequestHandlerControllerTest extends TestCase {
\OC::$server->getShareManager(),
$this->notifications,
$this->addressHandler,
- $this->userManager
+ $this->userManager,
+ $this->cloudIdManager
]
)->setMethods(['executeDeclineShare', 'verifyShare'])->getMock();