示例#1
0
 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);
 }
示例#2
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     \OC_User::createUser(self::TEST_ENCRYPTION_MIGRATION_USER1, 'foo');
     \OC_User::createUser(self::TEST_ENCRYPTION_MIGRATION_USER2, 'foo');
     \OC_User::createUser(self::TEST_ENCRYPTION_MIGRATION_USER3, 'foo');
 }
示例#3
0
文件: testcase.php 项目: evanjt/core
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $application = new Application();
     $application->registerMountProviders();
     // reset backend
     \OC_User::clearBackends();
     \OC_Group::clearBackends();
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     // create users
     $backend = new \Test\Util\User\Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER4, self::TEST_FILES_SHARING_API_USER4);
     // create group
     $groupBackend = new \OC_Group_Dummy();
     $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
     $groupBackend->createGroup('group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
     \OC_Group::useBackend($groupBackend);
 }
示例#4
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     \OC::$server->getUserManager()->createUser(self::TEST_ENCRYPTION_MIGRATION_USER1, 'foo');
     \OC::$server->getUserManager()->createUser(self::TEST_ENCRYPTION_MIGRATION_USER2, 'foo');
     \OC::$server->getUserManager()->createUser(self::TEST_ENCRYPTION_MIGRATION_USER3, 'foo');
 }
示例#5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // remember files_encryption state
     self::$stateFilesEncryption = \OC_App::isEnabled('files_encryption');
     //we don't want to tests with app files_encryption enabled
     \OC_App::disable('files_encryption');
     // 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');
     // create users
     $backend = new \OC_User_Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
     // create group
     $groupBackend = new \OC_Group_Dummy();
     $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
     $groupBackend->createGroup('group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
     \OC_Group::useBackend($groupBackend);
 }
示例#6
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // reset backend
     \OC_User::clearBackends();
     \OC_Group::clearBackends();
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // create users
     $backend = new \OC_User_Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
     // create group
     $groupBackend = new \OC_Group_Dummy();
     $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
     $groupBackend->createGroup('group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
     \OC_Group::useBackend($groupBackend);
 }
示例#7
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $application = new \OCA\Files_Sharing\AppInfo\Application();
     $application->registerMountProviders();
     // create test user
     self::loginHelper(self::TEST_VERSIONS_USER2, true);
     self::loginHelper(self::TEST_VERSIONS_USER, true);
 }
示例#8
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // reset backend
     \OC_User::clearBackends();
     \OC_Group::clearBackends();
     // create users
     $backend = new \Test\Util\User\Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
 }
示例#9
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCA\Files_Versions\Hooks::connectHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // create test user
     self::loginHelper(self::TEST_VERSIONS_USER2, true);
     self::loginHelper(self::TEST_VERSIONS_USER, true);
 }
示例#10
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // reset backend
     \OC_User::clearBackends();
     \OC_User::useBackend('database');
     \OCA\Files_Encryption\Helper::registerFilesystemHooks();
     \OCA\Files_Encryption\Helper::registerUserHooks();
     \OCA\Files_Encryption\Helper::registerShareHooks();
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // clear and register hooks
     \OC_FileProxy::clearProxies();
     \OC_FileProxy::register(new \OCA\Files_Encryption\Proxy());
 }
示例#11
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $query = \OC_DB::prepare('INSERT INTO `*PREFIX*appconfig` VALUES (?, ?, ?)');
     $query->execute(array('testapp', 'enabled', 'true'));
     $query->execute(array('testapp', 'installed_version', '1.2.3'));
     $query->execute(array('testapp', 'depends_on', 'someapp'));
     $query->execute(array('testapp', 'deletethis', 'deletethis'));
     $query->execute(array('testapp', 'key', 'value'));
     $query->execute(array('someapp', 'key', 'value'));
     $query->execute(array('someapp', 'otherkey', 'othervalue'));
     $query->execute(array('123456', 'key', 'value'));
     $query->execute(array('123456', 'enabled', 'false'));
     $query->execute(array('anotherapp', 'key', 'value'));
     $query->execute(array('anotherapp', 'enabled', 'false'));
 }
示例#12
0
 public static function setUpBeforeClass()
 {
     parent::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
     \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);
 }
 /**
  *
  */
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // have to make instance static to preserve data between tests
     self::$instance = new HookManager();
 }
示例#14
0
 public static function setUpBeforeClass()
 {
     self::dropTestTable();
     parent::setUpBeforeClass();
 }
示例#15
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     \Sabre\VObject\Component\VCard::$propertyMap['CATEGORIES'] = 'OCA\\Contacts\\VObject\\GroupProperty';
 }