本文整理汇总了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);
}
示例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');
}
示例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);
}
示例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');
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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'));
}
示例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);
}
示例13: setUpBeforeClass
/**
*
*/
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// have to make instance static to preserve data between tests
self::$instance = new HookManager();
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
self::dropTestTable();
parent::setUpBeforeClass();
}
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
\Sabre\VObject\Component\VCard::$propertyMap['CATEGORIES'] = 'OCA\\Contacts\\VObject\\GroupProperty';
}