dont change the encryption key during the test case

This commit is contained in:
Robin Appelman 2012-06-21 18:53:10 +02:00
parent bd8b921de4
commit 46ad51cbe2
1 changed files with 5 additions and 0 deletions

View 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(){