diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-09-19 21:37:52 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-09-24 00:57:58 +0200 |
commit | 235517f111a6d570e43cff1cd3701553412fc1a3 (patch) | |
tree | 7a5ea49b84fdcd63e8cdd21dc160e3e659434500 /tests | |
parent | bc1c6039b798c9460b8bbb8ef24b0f2d12229810 (diff) | |
download | nextcloud-server-235517f111a6d570e43cff1cd3701553412fc1a3.tar.gz nextcloud-server-235517f111a6d570e43cff1cd3701553412fc1a3.zip |
clear permissions cache when scanning a file
Diffstat (limited to 'tests')
-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 7e6e11e2eb2..4b284c2c8e2 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 @@ -55,4 +57,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')); + } } |