]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont change the encryption key during the test case
authorRobin Appelman <icewind@owncloud.com>
Thu, 21 Jun 2012 16:53:10 +0000 (18:53 +0200)
committerRobin Appelman <icewind@owncloud.com>
Thu, 21 Jun 2012 16:53:52 +0000 (18:53 +0200)
apps/files_encryption/tests/proxy.php

index 4533289265a316abc47e96299da1125990288048..fcfc4cfb9f0bcd43bb76e5705c09cff82d005eb7 100644 (file)
@@ -8,10 +8,12 @@
 
 class Test_CryptProxy extends UnitTestCase {
        private $oldConfig;
+       private $oldKey;
        
        public function setUp(){
                $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
                OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+               $this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
        
                
                //set testing key
@@ -36,6 +38,9 @@ class Test_CryptProxy extends UnitTestCase {
 
        public function tearDown(){
                OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
+               if(!is_null($this->oldKey)){
+                       $_SESSION['enckey']=$this->oldKey;
+               }
        }
 
        public function testSimple(){