aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-01-04 08:59:43 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-13 12:58:50 +0200
commit12afd7d1d5bc2a85d04815964bf7fb37e77466d6 (patch)
tree11cd311669ab0b2895e3d471bcf974e3f287e31d /apps/federatedfilesharing/tests
parent2cbac3357ba445a3a4cd073e119efb871ea0f719 (diff)
downloadnextcloud-server-12afd7d1d5bc2a85d04815964bf7fb37e77466d6.tar.gz
nextcloud-server-12afd7d1d5bc2a85d04815964bf7fb37e77466d6.zip
Add mail element to access list
* Each provider just returns what they have so adding an element won't require changing everything * Added tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/federatedfilesharing/tests')
-rw-r--r--apps/federatedfilesharing/tests/FederatedShareProviderTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
index d9bc9a7e2ad..7d571b2082c 100644
--- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
+++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
@@ -788,4 +788,32 @@ class FederatedShareProviderTest extends \Test\TestCase {
$u1->delete();
$u2->delete();
}
+
+ public function testGetAccessList() {
+ $userManager = \OC::$server->getUserManager();
+ $rootFolder = \OC::$server->getRootFolder();
+
+ $u1 = $userManager->createUser('testFed', md5(time()));
+
+ $folder1 = $rootFolder->getUserFolder($u1->getUID())->newFolder('foo');
+ $file1 = $folder1->newFile('bar1');
+
+ $this->tokenHandler->method('generateToken')->willReturn('token');
+ $this->notifications
+ ->method('sendRemoteShare')
+ ->willReturn(true);
+
+ $share1 = $this->shareManager->newShare();
+ $share1->setSharedWith('user@server.com')
+ ->setSharedBy($u1->getUID())
+ ->setShareOwner($u1->getUID())
+ ->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setNode($file1);
+ $this->provider->create($share1);
+
+ $result = $this->provider->getAccessList([$file1], true);
+
+ $this->assertSame(['remote' => true], $result);
+ $u1->delete();
+ }
}