diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-10 15:19:21 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-10 15:19:21 +0200 |
commit | a7c611039d4ff2008441d0cc79eefcd61fccac48 (patch) | |
tree | 98f08dd6db666b24178ad3e5a6fe7e50eaa44aa9 /tests | |
parent | afea05d296831603b90a4087cde1724142e4ef26 (diff) | |
download | nextcloud-server-a7c611039d4ff2008441d0cc79eefcd61fccac48.tar.gz nextcloud-server-a7c611039d4ff2008441d0cc79eefcd61fccac48.zip |
Dont use the permissions mask while scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php index 9859915e2cb..d0903ce5f97 100644 --- a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php +++ b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php @@ -10,6 +10,9 @@ namespace Test\Files\Storage\Wrapper; use OCP\Constants; +/** + * @group DB + */ class PermissionsMaskTest extends \Test\Files\Storage\Storage { /** @@ -102,4 +105,13 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage { $storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE); $this->assertFalse($storage->fopen('foo', 'w')); } + + public function testScanNewFiles() { + $storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE); + $storage->file_put_contents('foo', 'bar'); + $storage->getScanner()->scan(''); + + $this->assertEquals(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE, $this->sourceStorage->getCache()->get('foo')->getPermissions()); + $this->assertEquals(Constants::PERMISSION_READ, $storage->getCache()->get('foo')->getPermissions()); + } } |