diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-09-19 21:37:52 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-11-25 11:15:32 +0100 |
commit | b5d04b05a09522e60e171ce4a3616d1a3779bac0 (patch) | |
tree | 2430d84eb9d999b982476acaf4e0d06ecacfbcbf /tests/lib | |
parent | 880769976bbc8c75186c89268c78bc40efb80998 (diff) | |
download | nextcloud-server-b5d04b05a09522e60e171ce4a3616d1a3779bac0.tar.gz nextcloud-server-b5d04b05a09522e60e171ce4a3616d1a3779bac0.zip |
clear permissions cache when scanning a file
Conflicts:
lib/files/cache/scanner.php
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/files/cache/permissions.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/files/cache/permissions.php b/tests/lib/files/cache/permissions.php index 56dbbc4518e..64a32fa6b71 100644 --- a/tests/lib/files/cache/permissions.php +++ b/tests/lib/files/cache/permissions.php @@ -8,6 +8,8 @@ namespace Test\Files\Cache; +use OC\Files\Storage\Temporary; + class Permissions extends \PHPUnit_Framework_TestCase { /*** * @var \OC\Files\Cache\Permissions $permissionsCache @@ -53,4 +55,19 @@ class Permissions extends \PHPUnit_Framework_TestCase { $this->permissionsCache->removeMultiple($ids, $user); } + + public function testUpdatePermissionsOnRescan() { + $storage = new Temporary(array()); + $scanner = $storage->getScanner(); + $cache = $storage->getCache(); + $permissionsCache = $storage->getPermissionsCache(); + + $storage->file_put_contents('foo.txt', 'bar'); + $scanner->scan(''); + $id = $cache->getId('foo.txt'); + $permissionsCache->set($id, 'test', 1); + + $scanner->scan(''); + $this->assertEquals(-1, $permissionsCache->get($id, 'test')); + } } |