本文整理汇总了PHP中TestCase::setUpBeforeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::setUpBeforeClass方法的具体用法?PHP TestCase::setUpBeforeClass怎么用?PHP TestCase::setUpBeforeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestCase
的用法示例。
在下文中一共展示了TestCase::setUpBeforeClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$CI =& get_instance();
$CI->load->library('Seeder');
$CI->seeder->call('CategorySeeder');
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1, true);
self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER2, true);
self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER3, true);
}
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$CI =& get_instance();
$CI->load->database();
$CI->db->truncate('keys');
}
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$serviceStates = static::$_client->server()->getServiceStates();
static::$_isMailSupported = $serviceStates['smtp'] && 'running' == $serviceStates['smtp']['state'];
static::$_webspace = static::_createWebspace('example.dom');
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// trashbin hooks
\OCA\Files_Trashbin\Trashbin::registerHooks();
// create test user
self::loginHelper(self::TEST_ENCRYPTION_TRASHBIN_USER1, true);
}
示例6: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::$defaultTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
self::$oneDay = self::$oneHour * 24;
self::$oneYear = self::$oneDay * 365;
}
示例7: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
if (!defined('ONPHP_CURL_TEST_URL')) {
self::$failTestMsg = 'not defined test constant ONPHP_CURL_TEST_URL';
}
self::$emptyMsg = file_get_contents(ONPHP_CURL_TEST_URL);
}
示例8: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::$application = \Stormpath\Resource\Application::instantiate(array('name' => uniqid() . 'ApplicationTest', 'description' => 'Description of Main App', 'status' => 'enabled'));
self::createResource(\Stormpath\Resource\Application::PATH, self::$application, array('createDirectory' => true));
self::$account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'Account Name', 'middleName' => 'Middle Name', 'surname' => 'Surname', 'username' => 'username' . uniqid(), 'email' => 'username' . uniqid() . '@unknown123.kot', 'password' => 'superP4ss'));
self::$application->createAccount(self::$account);
self::$provider = new \Stormpath\StormpathUserProvider(self::$client, self::$application);
}
示例9: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// note: not using a data provider because these
// files all need to coexist to make sure the
// share keys are found properly (pattern matching)
self::$testFiles = array('t est.txt', 't est_.txt', 't est.doc.txt', 't est(.*).txt', 'multiple.dots.can.happen.too.txt', 't est.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.txt', 't est_.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey.txt', 'who would upload their.shareKey', 'user ones file.txt', 'user ones file.txt.backup', '.t est.txt');
// create test user
self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1, true);
self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2, true);
}
示例10: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// disable file proxy by default
\OC_FileProxy::$enabled = false;
// remember files_trashbin state
self::$stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
// create test user
\OC_User::deleteUser(self::TEST_USER);
parent::loginHelper(self::TEST_USER, true);
}
示例11: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// create test user
self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1, true);
self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER2, true);
self::loginHelper(self::TEST_ENCRYPTION_UTIL_LEGACY_USER, true);
// create groups
\OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
\OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP2);
// add user 1 to group1
\OC_Group::addToGroup(self::TEST_ENCRYPTION_UTIL_USER1, self::TEST_ENCRYPTION_UTIL_GROUP1);
}
示例12: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// enable resharing
\OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes');
// register share hooks
\OC::registerShareHooks();
\OCA\Files_Sharing\Helper::registerHooks();
// clear and register hooks
\OC_FileProxy::register(new \OCA\Files\Share\Proxy());
// create users
self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1, true);
self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2, true);
self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3, true);
self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER4, true);
// create group and assign users
\OC_Group::createGroup(self::TEST_ENCRYPTION_SHARE_GROUP1);
\OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER3, self::TEST_ENCRYPTION_SHARE_GROUP1);
\OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER4, self::TEST_ENCRYPTION_SHARE_GROUP1);
}
示例13: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::$ci =& get_instance();
}
示例14: setUpBeforeClass
/**
* This method is called before the first test of this test class is run.
*
* @since Method available since Release 3.4.0
*/
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
}
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
/**
* get config
*/
if (isset($_SERVER['TRAVIS_DB'])) {
static::$config = static::$travis_dbs[$_SERVER['TRAVIS_DB']];
} else {
static::$config = (include APPPATH . 'config' . DS . \Fuel::DEVELOPMENT . DS . 'dbdocs.php');
static::$config = \Arr::get(static::$config, 'test_config.db');
}
/**
* connect to db
*/
static::$dd = Dbdocs::forge('default', static::$config);
/**
* drop views
*/
krsort(static::$test_views);
foreach (static::$test_views as $test_view_name => $sql) {
try {
//TODO: check view exist
static::$dd->sm->dropView($test_view_name);
} catch (\Doctrine\DBAL\DBALException $e) {
//do nothing
}
}
/**
* drop tables
*/
krsort(static::$test_tables);
foreach (static::$test_tables as $test_table_name => $infos) {
static::$dd->sm->tablesExist($test_table_name) and static::$dd->sm->dropTable($test_table_name);
}
/**
* create tables
*/
ksort(static::$test_tables);
foreach (static::$test_tables as $test_table_name => $infos) {
$table = new \Doctrine\DBAL\Schema\Table($test_table_name);
foreach ($infos['columns'] as $column) {
empty($column['options']) and $column['options'] = array();
$table->addColumn($column['name'], $column['type'], $column['options']);
}
$table->setPrimaryKey($infos['primary_keys']);
if (!empty($infos['foreign_keys'])) {
foreach ($infos['foreign_keys'] as $foreign_key) {
list($to_table_name, $to_column_name) = explode(".", $foreign_key['to']);
$table->addForeignKeyConstraint($to_table_name, array($foreign_key['from']), array($to_column_name));
}
}
static::$dd->sm->createTable($table);
}
/**
* create views
*/
ksort(static::$test_views);
foreach (static::$test_views as $test_view_name => $sql) {
$view = new \Doctrine\DBAL\Schema\View($test_view_name, $sql);
static::$dd->sm->createView($view);
}
}