aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-07-13 17:29:57 +0200
committerGitHub <noreply@github.com>2018-07-13 17:29:57 +0200
commit82021b2b1bd6e6ae9c85564ba614797a1110e29c (patch)
treedcae47bf607411ae0e2e4e54ed5715aa98354c35 /tests
parent14314584ba88ed8d8a7c8486b61c6677a14271f2 (diff)
parent4f5814c27bc43a8f10bd35f60bc3254697c50659 (diff)
downloadnextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.tar.gz
nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.zip
Merge pull request #5280 from nextcloud/shared-with-display-name
sharedWithDisplayName & sharedWithAvatar
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Share20/DefaultShareProviderTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php
index 0fa8aa3d0c6..230c8db40ce 100644
--- a/tests/lib/Share20/DefaultShareProviderTest.php
+++ b/tests/lib/Share20/DefaultShareProviderTest.php
@@ -629,6 +629,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
$share->setSharedBy('sharedBy');
$share->setShareOwner('shareOwner');
$share->setNode($path);
+ $share->setSharedWithDisplayName('Displayed Name');
+ $share->setSharedWithAvatar('/path/to/image.svg');
$share->setPermissions(1);
$share->setTarget('/target');
@@ -644,6 +646,12 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame('/target', $share2->getTarget());
$this->assertLessThanOrEqual(new \DateTime(), $share2->getShareTime());
$this->assertSame($path, $share2->getNode());
+
+ // nothing from setSharedWithDisplayName/setSharedWithAvatar is saved in DB
+ $this->assertSame('Displayed Name', $share->getSharedWithDisplayName());
+ $this->assertSame('/path/to/image.svg', $share->getSharedWithAvatar());
+ $this->assertSame(null, $share2->getSharedWithDisplayName());
+ $this->assertSame(null, $share2->getSharedWithAvatar());
}
public function testCreateGroupShare() {
@@ -678,6 +686,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
$share->setShareOwner('shareOwner');
$share->setNode($path);
$share->setPermissions(1);
+ $share->setSharedWithDisplayName('Displayed Name');
+ $share->setSharedWithAvatar('/path/to/image.svg');
$share->setTarget('/target');
$share2 = $this->provider->create($share);
@@ -692,6 +702,13 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame('/target', $share2->getTarget());
$this->assertLessThanOrEqual(new \DateTime(), $share2->getShareTime());
$this->assertSame($path, $share2->getNode());
+
+ // nothing from setSharedWithDisplayName/setSharedWithAvatar is saved in DB
+ $this->assertSame('Displayed Name', $share->getSharedWithDisplayName());
+ $this->assertSame('/path/to/image.svg', $share->getSharedWithAvatar());
+ $this->assertSame(null, $share2->getSharedWithDisplayName());
+ $this->assertSame(null, $share2->getSharedWithAvatar());
+
}
public function testCreateLinkShare() {