diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-12-19 11:32:02 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-12-19 16:04:13 +0100 |
commit | aea991c22e3b60c0cc097195ac3a759313ad44f8 (patch) | |
tree | aba8889ecd6cb541a7df0992c3b2fb537d525243 /apps/files_encryption/tests/testcase.php | |
parent | 10a0fc2856bfa68ff04a42f141829a6e66a9b2da (diff) | |
download | nextcloud-server-aea991c22e3b60c0cc097195ac3a759313ad44f8.tar.gz nextcloud-server-aea991c22e3b60c0cc097195ac3a759313ad44f8.zip |
cache keys to read them only once from the hard disc
Diffstat (limited to 'apps/files_encryption/tests/testcase.php')
-rw-r--r-- | apps/files_encryption/tests/testcase.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/files_encryption/tests/testcase.php b/apps/files_encryption/tests/testcase.php index 9cb724648cb..c2e5f4de8c1 100644 --- a/apps/files_encryption/tests/testcase.php +++ b/apps/files_encryption/tests/testcase.php @@ -79,4 +79,18 @@ abstract class TestCase extends \Test\TestCase { parent::tearDownAfterClass(); } + + protected function tearDown() { + parent::tearDown(); + $this->resetKeyCache(); + } + + protected function resetKeyCache() { + // reset key cache for every testrun + $keyCache = new \ReflectionProperty('\OCA\Files_Encryption\Keymanager', 'key_cache'); + $keyCache->setAccessible(true); + $keyCache->setValue(array()); + $keyCache->setAccessible(false); + } + } |