public static function setUpBeforeClass() { parent::setUpBeforeClass(); $appManager = \OC::$server->getAppManager(); self::$trashBinStatus = $appManager->isEnabledForUser('files_trashbin'); // reset backend \OC_User::clearBackends(); \OC_User::useBackend('database'); // clear share hooks \OC_Hook::clear('OCP\\Share'); \OC::registerShareHooks(); $application = new \OCA\Files_Sharing\AppInfo\Application(); $application->registerMountProviders(); //disable encryption \OC_App::disable('encryption'); $config = \OC::$server->getConfig(); //configure trashbin self::$rememberRetentionObligation = $config->getSystemValue('trashbin_retention_obligation', Files_Trashbin\Expiration::DEFAULT_RETENTION_OBLIGATION); $config->setSystemValue('trashbin_retention_obligation', 'auto, 2'); // register hooks Files_Trashbin\Trashbin::registerHooks(); // create test user self::loginHelper(self::TEST_TRASHBIN_USER2, true); self::loginHelper(self::TEST_TRASHBIN_USER1, true); }
public static function setUpBeforeClass() { // reset backend \OC_User::clearBackends(); \OC_User::useBackend('database'); // clear share hooks \OC_Hook::clear('OCP\\Share'); \OC::registerShareHooks(); \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup'); //disable encryption self::$encryptionStatus = \OC_App::isEnabled('files_encryption'); \OC_App::disable('files_encryption'); //configure trashbin self::$rememberRetentionObligation = \OC_Config::getValue('trashbin_retention_obligation', Files_Trashbin\Trashbin::DEFAULT_RETENTION_OBLIGATION); \OC_Config::setValue('trashbin_retention_obligation', 2); self::$rememberAutoExpire = \OC_Config::getValue('trashbin_auto_expire', true); \OC_Config::setValue('trashbin_auto_expire', true); // register hooks Files_Trashbin\Trashbin::registerHooks(); // create test user self::loginHelper(self::TEST_TRASHBIN_USER2, true); self::loginHelper(self::TEST_TRASHBIN_USER1, true); }