Ejemplo n.º 1
0
 public function setUp()
 {
     //set testing key
     $_SESSION['enckey'] = md5(time());
     //clear all proxies and hooks so we can do clean testing
     OC_FileProxy::clearProxies();
     OC_Hook::clear('OC_Filesystem');
     //enable only the encryption hook
     OC_FileProxy::register(new OC_FileProxy_Encryption());
     //set up temporary storage
     OC_Filesystem::clearMounts();
     OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
     //set up the users home folder in the temp storage
     $rootView = new OC_FilesystemView('');
     $rootView->mkdir('/' . OC_User::getUser());
     $rootView->mkdir('/' . OC_User::getUser() . '/files');
 }
Ejemplo n.º 2
0
 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
     $_SESSION['enckey'] = md5(time());
     //clear all proxies and hooks so we can do clean testing
     OC_FileProxy::clearProxies();
     OC_Hook::clear('OC_Filesystem');
     //enable only the encryption hook
     OC_FileProxy::register(new OC_FileProxy_Encryption());
     //set up temporary storage
     OC_Filesystem::clearMounts();
     OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
     //set up the users home folder in the temp storage
     $rootView = new OC_FilesystemView('');
     $rootView->mkdir('/' . OC_User::getUser());
     $rootView->mkdir('/' . OC_User::getUser() . '/files');
 }
Ejemplo n.º 3
0
 public function setUp()
 {
     //clear all proxies and hooks so we can do clean testing
     OC_FileProxy::clearProxies();
     OC_Hook::clear('OC_Filesystem');
     //enable only the encryption hook if needed
     if (OC_App::isEnabled('files_encryption')) {
         OC_FileProxy::register(new OC_FileProxy_Encryption());
     }
     //set up temporary storage
     OC_Filesystem::clearMounts();
     OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
     OC_User::clearBackends();
     OC_User::useBackend(new OC_User_Dummy());
     //login
     OC_User::createUser('test', 'test');
     $this->user = OC_User::getUser();
     OC_User::setUserId('test');
     //set up the users dir
     $rootView = new OC_FilesystemView('');
     $rootView->mkdir('/test');
     $this->instance = new OC_Cache_File();
 }
Ejemplo n.º 4
0
 public function setUp()
 {
     OC_Filesystem::clearMounts();
 }