summaryrefslogtreecommitdiffstats
path: root/tests/lib/Share20/DefaultShareProviderTest.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@nextcloud.com>2017-07-06 11:55:22 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-05-21 01:24:45 +0200
commit4f5814c27bc43a8f10bd35f60bc3254697c50659 (patch)
tree1d743623ddfcc3f3c3cce9814dc3fbc512f48b5c /tests/lib/Share20/DefaultShareProviderTest.php
parent2e3517eb00a7eb40bc9202fa4548fc97a39ec52f (diff)
downloadnextcloud-server-4f5814c27bc43a8f10bd35f60bc3254697c50659.tar.gz
nextcloud-server-4f5814c27bc43a8f10bd35f60bc3254697c50659.zip
tests
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
Diffstat (limited to 'tests/lib/Share20/DefaultShareProviderTest.php')
-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() {