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


PHP TestCase::setUpBeforeClass方法代码示例

本文整理汇总了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');
 }
开发者ID:kenjis,项目名称:ci-hmvc-ci-phpunit-test,代码行数:7,代码来源:Category_model_test.php

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

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $CI =& get_instance();
     $CI->load->database();
     $CI->db->truncate('keys');
 }
开发者ID:gufakto,项目名称:ci-app-for-ci-phpunit-test,代码行数:7,代码来源:Key_test.php

示例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');
 }
开发者ID:plesk,项目名称:api-php-lib,代码行数:7,代码来源:MailTest.php

示例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);
 }
开发者ID:samj1912,项目名称:repo,代码行数:8,代码来源:trashbin.php

示例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;
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:8,代码来源:datetimeformatter.php

示例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);
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:8,代码来源:CurlHttpClientTest.class.php

示例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);
 }
开发者ID:stormpath,项目名称:stormpath-laravel-auth-driver,代码行数:9,代码来源:StormpathUserProviderTest.php

示例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);
 }
开发者ID:kebenxiaoming,项目名称:owncloudRedis,代码行数:11,代码来源:hooks.php

示例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);
 }
开发者ID:samj1912,项目名称:repo,代码行数:13,代码来源:keymanager.php

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

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

示例13: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$ci =& get_instance();
 }
开发者ID:ardissoebrata,项目名称:ci-beam,代码行数:5,代码来源:Template_test.php

示例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();
 }
开发者ID:ebbz,项目名称:firefly-iii,代码行数:9,代码来源:GoogleAccountChartGeneratorTest.php

示例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);
     }
 }
开发者ID:mp-php,项目名称:fuel-packages-dbdocs,代码行数:63,代码来源:testcase.php


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