summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/api.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-05-27 23:51:24 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-06 09:56:00 +0200
commit501f98f084d243007ee64ad7a4386964d98f536a (patch)
tree03a57923fe8148f3902adc6c508c5f9b75715f8f /apps/files_sharing/tests/api.php
parent9a48e8725321eb4f282ee49f14af01efad0471ef (diff)
downloadnextcloud-server-501f98f084d243007ee64ad7a4386964d98f536a.tar.gz
nextcloud-server-501f98f084d243007ee64ad7a4386964d98f536a.zip
update share API tests, file shares never have delete permissions
Diffstat (limited to 'apps/files_sharing/tests/api.php')
-rw-r--r--apps/files_sharing/tests/api.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 6d0ed434ef2..3c683afacb4 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -784,7 +784,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$fileInfo = $this->view->getFileInfo($this->filename);
$result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
// share was successful?
$this->assertTrue($result);
@@ -816,9 +816,11 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$this->assertTrue(is_array($linkShare));
$this->assertTrue(is_array($userShare));
- // update permissions
+ // check if share have expected permissions, single shared files never have
+ // delete permissions
+ $this->assertEquals(\OCP\PERMISSION_ALL & ~\OCP\PERMISSION_DELETE, $userShare['permissions']);
- $this->assertEquals('31', $userShare['permissions']);
+ // update permissions
$params = array();
$params['id'] = $userShare['id'];
@@ -893,7 +895,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$items = \OCP\Share::getItemShared('file', null);
// make sure that we found a link share and a user share
- $this->assertEquals(count($items), 1);
+ $this->assertEquals(1, count($items));
$linkShare = null;