summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federatedfilesharing/tests/FederatedShareProviderTest.php')
-rw-r--r--apps/federatedfilesharing/tests/FederatedShareProviderTest.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
index 52266383b36..98ad8832fa1 100644
--- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
+++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
@@ -33,6 +33,7 @@ use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\FederatedFileSharing\Notifications;
use OCA\FederatedFileSharing\TokenHandler;
+use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudIdManager;
use OCP\Files\File;
use OCP\Files\IRootFolder;
@@ -80,6 +81,8 @@ class FederatedShareProviderTest extends \Test\TestCase {
/** @var ICloudIdManager */
private $cloudIdManager;
+ /** @var \PHPUnit_Framework_MockObject_MockObject|ICloudFederationProviderManager */
+ private $cloudFederationProviderManager;
public function setUp() {
parent::setUp();
@@ -107,6 +110,8 @@ class FederatedShareProviderTest extends \Test\TestCase {
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
+ $this->cloudFederationProviderManager = $this->createMock(ICloudFederationProviderManager::class);
+
$this->provider = new FederatedShareProvider(
$this->connection,
$this->addressHandler,
@@ -118,7 +123,8 @@ class FederatedShareProviderTest extends \Test\TestCase {
$this->config,
$this->userManager,
$this->cloudIdManager,
- $this->gsConfig
+ $this->gsConfig,
+ $this->cloudFederationProviderManager
);
$this->shareManager = \OC::$server->getShareManager();
@@ -141,6 +147,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->tokenHandler->method('generateToken')->willReturn('token');
@@ -212,6 +219,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->tokenHandler->method('generateToken')->willReturn('token');
@@ -268,6 +276,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->tokenHandler->method('generateToken')->willReturn('token');
@@ -367,6 +376,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->tokenHandler->method('generateToken')->willReturn('token');
@@ -417,7 +427,8 @@ class FederatedShareProviderTest extends \Test\TestCase {
$this->config,
$this->userManager,
$this->cloudIdManager,
- $this->gsConfig
+ $this->gsConfig,
+ $this->cloudFederationProviderManager
]
)->setMethods(['sendPermissionUpdate'])->getMock();
@@ -435,6 +446,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy($sharedBy)
->setShareOwner($owner)
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->tokenHandler->method('generateToken')->willReturn('token');
@@ -505,6 +517,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share);
@@ -513,6 +526,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy2')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share2);
@@ -543,6 +557,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share);
@@ -555,6 +570,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node2);
$this->provider->create($share2);
@@ -584,6 +600,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('shareOwner')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share);
@@ -592,6 +609,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share2);
@@ -628,6 +646,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share);
@@ -636,6 +655,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy('sharedBy')
->setShareOwner('shareOwner')
->setPermissions(19)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($node);
$this->provider->create($share2);
@@ -826,6 +846,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy($u1->getUID())
->setShareOwner($u1->getUID())
->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($file1);
$this->provider->create($share1);
@@ -834,6 +855,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy($u2->getUID())
->setShareOwner($u1->getUID())
->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($file2);
$this->provider->create($share2);
@@ -880,6 +902,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy($u1->getUID())
->setShareOwner($u1->getUID())
->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($file1);
$this->provider->create($share1);
@@ -888,6 +911,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
->setSharedBy($u1->getUID())
->setShareOwner($u1->getUID())
->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setShareType(\OCP\Share::SHARE_TYPE_REMOTE)
->setNode($file1);
$this->provider->create($share2);