From 961e4e5c7ce315c29cbae720e41ee50b91331e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 5 Jun 2014 20:33:52 +0200 Subject: [PATCH] adjust unit test assert values --- apps/files_sharing/tests/permissions.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/files_sharing/tests/permissions.php b/apps/files_sharing/tests/permissions.php index bff7109518..2cbc412d26 100644 --- a/apps/files_sharing/tests/permissions.php +++ b/apps/files_sharing/tests/permissions.php @@ -141,16 +141,14 @@ class Test_Files_Sharing_Permissions extends Test_Files_Sharing_Base { $this->assertEquals('subdir', $contents[0]['name']); $this->assertEquals(31, $contents[0]['permissions']); $this->assertEquals('textfile.txt', $contents[1]['name']); - $this->assertEquals(31, $contents[1]['permissions']); + // 27 is correct because create is reserved to folders only - requires more unit tests overall to ensure this + $this->assertEquals(27, $contents[1]['permissions']); $contents = $this->secondView->getDirectoryContent('files/shareddirrestricted'); $this->assertEquals('subdir', $contents[0]['name']); - $this->assertEquals(7, $contents[0]['permissions']); + $this->assertEquals(7 | \OCP\PERMISSION_DELETE, $contents[0]['permissions']); $this->assertEquals('textfile1.txt', $contents[1]['name']); - $this->assertEquals(7, $contents[1]['permissions']); - - // the share mount point should always have delete permissions to allow the user - // to unmount it - $restrictedShare = $this->secondView->getFileInfo('files/shareddirrestricted'); - $this->assertEquals(7 | \OCP\PERMISSION_DELETE, $restrictedShare['permissions']); + // 3 is correct because create is reserved to folders only + // delete permissions are added since mount points can always be deleted + $this->assertEquals(3 | \OCP\PERMISSION_DELETE, $contents[1]['permissions']); } }