当前位置: 首页>>代码示例>>PHP>>正文


PHP TestCase::setUpBeforeClass方法代码示例

本文整理汇总了PHP中Test\TestCase::setUpBeforeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::setUpBeforeClass方法的具体用法?PHP TestCase::setUpBeforeClass怎么用?PHP TestCase::setUpBeforeClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Test\TestCase的用法示例。


在下文中一共展示了TestCase::setUpBeforeClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUpBeforeClass

 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);
 }
开发者ID:loulancn,项目名称:core,代码行数:25,代码来源:trashbin.php

示例2: setUpBeforeClass

 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');
 }
开发者ID:0x17de,项目名称:core,代码行数:7,代码来源:MigrationTest.php

示例3: setUpBeforeClass

 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);
 }
开发者ID:evanjt,项目名称:core,代码行数:28,代码来源:testcase.php

示例4: setUpBeforeClass

 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');
 }
开发者ID:gvde,项目名称:core,代码行数:7,代码来源:MigrationTest.php

示例5: setUpBeforeClass

 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);
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:30,代码来源:testcase.php

示例6: setUpBeforeClass

 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);
 }
开发者ID:adolfo2103,项目名称:hcloudfilem,代码行数:26,代码来源:testcase.php

示例7: setUpBeforeClass

 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);
 }
开发者ID:sunblade,项目名称:core,代码行数:9,代码来源:versions.php

示例8: setUpBeforeClass

 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);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:12,代码来源:TestCase.php

示例9: setUpBeforeClass

 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);
 }
开发者ID:adolfo2103,项目名称:hcloudfilem,代码行数:12,代码来源:versions.php

示例10: setUpBeforeClass

 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());
 }
开发者ID:yheric455042,项目名称:owncloud82,代码行数:15,代码来源:testcase.php

示例11: setUpBeforeClass

 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'));
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:16,代码来源:appconfig.php

示例12: setUpBeforeClass

 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);
 }
开发者ID:adolfo2103,项目名称:hcloudfilem,代码行数:23,代码来源:trashbin.php

示例13: setUpBeforeClass

 /**
  *
  */
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // have to make instance static to preserve data between tests
     self::$instance = new HookManager();
 }
开发者ID:brunomilet,项目名称:owncloud-core,代码行数:9,代码来源:HookManagerTest.php

示例14: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     self::dropTestTable();
     parent::setUpBeforeClass();
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:5,代码来源:ConnectionTest.php

示例15: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     \Sabre\VObject\Component\VCard::$propertyMap['CATEGORIES'] = 'OCA\\Contacts\\VObject\\GroupProperty';
 }
开发者ID:gvde,项目名称:contacts-8,代码行数:5,代码来源:vobjectTest.php


注:本文中的Test\TestCase::setUpBeforeClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。