[Pkg-owncloud-commits] [owncloud] 05/15: Added unit test to verify link password removeal
David Prévot
taffit at moszumanska.debian.org
Thu Jul 2 18:39:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.0.5RC1
in repository owncloud.
commit cc0b1e4bf650baa5290aed05f954b0ef785c90c8
Author: Roeland Jago Douma <roeland at famdouma.nl>
Date: Wed Jun 24 12:37:24 2015 +0200
Added unit test to verify link password removeal
---
apps/files_sharing/tests/api.php | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 232fcf2..0b8778d 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -851,7 +851,6 @@ class Test_Files_Sharing_Api extends TestCase {
$this->assertEquals('1', $newUserShare['permissions']);
// update password for link share
-
$this->assertTrue(empty($linkShare['share_with']));
$params = array();
@@ -876,6 +875,29 @@ class Test_Files_Sharing_Api extends TestCase {
$this->assertTrue(is_array($newLinkShare));
$this->assertTrue(!empty($newLinkShare['share_with']));
+ // Remove password for link share
+ $params = array();
+ $params['id'] = $linkShare['id'];
+ $params['_put'] = array();
+ $params['_put']['password'] = '';
+
+ $result = \OCA\Files_Sharing\API\Local::updateShare($params);
+
+ $this->assertTrue($result->succeeded());
+
+ $items = \OCP\Share::getItemShared('file', $linkShare['file_source']);
+
+ $newLinkShare = null;
+ foreach ($items as $item) {
+ if ($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
+ $newLinkShare = $item;
+ break;
+ }
+ }
+
+ $this->assertTrue(is_array($newLinkShare));
+ $this->assertTrue(empty($newLinkShare['share_with']));
+
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list