diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-10-27 12:27:09 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-11-01 19:54:41 +0100 |
commit | 6d7520b1e2c6e17b449a0c5cea886f73e9932528 (patch) | |
tree | adc7648c8eaeebfd9f71219efed50f888f6740c5 /apps/files_sharing/tests/ApiTest.php | |
parent | 1e930df91f1724e9bb9ab23a84f51fec31e514db (diff) | |
download | nextcloud-server-6d7520b1e2c6e17b449a0c5cea886f73e9932528.tar.gz nextcloud-server-6d7520b1e2c6e17b449a0c5cea886f73e9932528.zip |
unit tests updated and new added
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 6ab0cb4e1a6..540905a7dc9 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -234,6 +234,7 @@ class ApiTest extends TestCase { function testEnfoceLinkPassword() { + $password = md5(time()); $appConfig = \OC::$server->getAppConfig(); $appConfig->setValue('core', 'shareapi_enforce_links_password', 'yes'); @@ -257,14 +258,14 @@ class ApiTest extends TestCase { // share with password should succeed $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); - $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', 'bar'); + $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', $password); $ocs->cleanup(); $data = $result->getData(); // setting new password should succeed $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); - $ocs->updateShare($data['id'], null, 'bar'); + $ocs->updateShare($data['id'], null, $password); $ocs->cleanup(); // removing password should fail @@ -887,6 +888,9 @@ class ApiTest extends TestCase { * @depends testCreateShareLink */ function testUpdateShare() { + + $password = md5(time()); + $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -915,7 +919,7 @@ class ApiTest extends TestCase { $this->assertNull($share2->getPassword()); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); - $ocs->updateShare($share2->getId(), null, 'foo'); + $ocs->updateShare($share2->getId(), null, $password); $ocs->cleanup(); $share2 = $this->shareManager->getShareById('ocinternal:' . $share2->getId()); |