diff options
author | Maxence Lange <maxence@nextcloud.com> | 2017-07-06 11:55:22 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-05-21 01:24:45 +0200 |
commit | 4f5814c27bc43a8f10bd35f60bc3254697c50659 (patch) | |
tree | 1d743623ddfcc3f3c3cce9814dc3fbc512f48b5c /tests/lib/Share20/DefaultShareProviderTest.php | |
parent | 2e3517eb00a7eb40bc9202fa4548fc97a39ec52f (diff) | |
download | nextcloud-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.php | 17 |
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() { |