當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ThinkUpUnitTestCase類代碼示例

本文整理匯總了PHP中ThinkUpUnitTestCase的典型用法代碼示例。如果您正苦於以下問題:PHP ThinkUpUnitTestCase類的具體用法?PHP ThinkUpUnitTestCase怎麽用?PHP ThinkUpUnitTestCase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ThinkUpUnitTestCase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     global $TEST_SERVER_DOMAIN;
     $this->url = $TEST_SERVER_DOMAIN;
     $this->DEBUG = getenv('TEST_DEBUG') !== false ? true : false;
     putenv("MODE=TESTS");
     $this->get($this->url . '/install/setmode.php?m=tests');
     self::isWebTestEnvironmentReady();
     require THINKUP_ROOT_PATH . 'tests/config.tests.inc.php';
     $this->test_database_name = $TEST_DATABASE;
     if (ThinkUpUnitTestCase::ramDiskTestMode()) {
         putenv("RD_MODE=1");
         require THINKUP_WEBAPP_PATH . 'config.inc.php';
         $this->test_database_name = $THINKUP_CFG['db_name'];
         $this->get($this->url . '/install/setmode.php?rd=1');
     }
 }
開發者ID:rmanalan,項目名稱:ThinkUp,代碼行數:17,代碼來源:class.ThinkUpBasicWebTestCase.php

示例2: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->logger->close();
     //clear doesOwnerHaveAccessToPost query cache
     OwnerInstanceMySQLDAO::$post_access_query_cache = array();
 }
開發者ID:randi2kewl,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfOwnerInstanceMySQLDAO.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp = Webapp::getInstance();
     $webapp->registerPlugin('flickr', 'ExpandURLsPlugin');
     //Add owner
     $q = "INSERT INTO tu_owners SET id=1, full_name='ThinkUp J. User', email='me@example.com',\n        is_activated=1, pwd='XXX', activation_code='8888'";
     $this->testdb_helper->runSQL($q);
     //Add instance_owner
     $q = "INSERT INTO tu_owner_instances (owner_id, instance_id) VALUES (1, 1)";
     $this->testdb_helper->runSQL($q);
     //Insert test data into test table
     $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, last_updated) VALUES (13, 'ev',\n        'Ev Williams', 'avatar.jpg', '1/1/2005');";
     $this->testdb_helper->runSQL($q);
     //Make public
     $q = "INSERT INTO tu_instances (id, network_user_id, network_username, is_public) VALUES (1, 13, 'ev', 1);";
     $this->testdb_helper->runSQL($q);
     //Add a bunch of posts
     $counter = 0;
     while ($counter < 40) {
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $q = "INSERT INTO tu_posts (post_id, author_user_id, author_username, author_fullname, author_avatar,\n            post_text, source, pub_date, reply_count_cache, retweet_count_cache) VALUES ({$counter}, 13, 'ev', \n            'Ev Williams', 'avatar.jpg', 'This is post {$counter}', 'web', '2006-01-01 00:{$pseudo_minute}:00', " . rand(0, 4) . ", 5);";
         $this->testdb_helper->runSQL($q);
         $counter++;
     }
 }
開發者ID:unruthless,項目名稱:ThinkUp,代碼行數:26,代碼來源:TestOfExpandURLsPluginConfigurationController.php

示例4: tearDown

 public function tearDown()
 {
     $this->builders = null;
     parent::tearDown();
     $this->logger->close();
     $this->DAO = null;
 }
開發者ID:ngugijames,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfGroupMySQLDAO.php

示例5: tearDown

 public function tearDown()
 {
     $this->builder1 = null;
     $this->builder2 = null;
     $this->builder3 = null;
     parent::tearDown();
 }
開發者ID:unruthless,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfLoginController.php

示例6: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->logger->close();
     // clear options cache
     PluginOptionMySQLDAO::$cached_options = array();
 }
開發者ID:unruthless,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfPluginOptionMySQLDAO.php

示例7: tearDown

 public function tearDown()
 {
     $this->builders = null;
     parent::tearDown();
     //make sure our db_type is set to the default...
     Config::getInstance()->setValue('db_type', 'mysql');
 }
開發者ID:hendrasaputra,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfDAOFactory.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp = Webapp::getInstance();
     $webapp->registerPlugin('twitter', 'TwitterPlugin');
     $webapp->registerPlugin('facebook', 'FacebookPlugin');
 }
開發者ID:randi2kewl,項目名稱:ThinkUp,代碼行數:7,代碼來源:TestOfDashboardController.php

示例9: tearDown

 public function tearDown()
 {
     $this->builders = null;
     $this->logger->close();
     $this->instance = null;
     $this->api = null;
     parent::tearDown();
 }
開發者ID:pepeleproso,項目名稱:ThinkUp,代碼行數:8,代碼來源:TestOfTwitterCrawler.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $webapp_plugin_registrar->registerPlugin('facebook', 'FacebookPlugin');
     $webapp_plugin_registrar->registerPlugin('google+', 'GooglePlusPlugin');
 }
開發者ID:JWFoxJr,項目名稱:ThinkUp,代碼行數:8,代碼來源:TestOfDashboardController.php

示例11: tearDown

 public function tearDown()
 {
     parent::tearDown();
     if (getenv("TEST_TIMING") == "1") {
         list($usec, $sec) = explode(" ", microtime());
         $finish = (double) $usec + (double) $sec;
         $runtime = round($finish - $this->start);
         printf($runtime . " seconds\n");
     }
 }
開發者ID:ngugijames,項目名稱:ThinkUp,代碼行數:10,代碼來源:TestOfInstallerController.php

示例12: tearDown

 public function tearDown() {
     parent::tearDown();
     $zipfile = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/thinkup_db_backup.zip';
     $backup_dir = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/backup';
     if(file_exists($zipfile)) {
         unlink($zipfile);
     }
     if(file_exists($backup_dir)) {
         $this->recursiveDelete($backup_dir);
     }
 }
開發者ID:rgoncalves,項目名稱:ThinkUp,代碼行數:11,代碼來源:TestOfBackupMySQLDAO.php

示例13: tearDown

 public function tearDown()
 {
     parent::tearDown();
     MockUpgradeApplicationController::$current_exception = false;
     //Clean up test installation files
     $test_app_dir = THINKUP_WEBAPP_PATH . 'test_installer';
     if (file_exists($test_app_dir)) {
         exec('rm -rf ' . $test_app_dir);
     }
     parent::tearDown();
 }
開發者ID:JWFoxJr,項目名稱:ThinkUp,代碼行數:11,代碼來源:TestOfUpgradeApplicationController.php

示例14: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $config = Config::getInstance();
     $config->setValue("mandrill_api_key", "");
     // delete test email file if it exists
     $test_email = FileDataManager::getDataPath(Mailer::EMAIL);
     if (file_exists($test_email)) {
         unlink($test_email);
     }
 }
開發者ID:ngugijames,項目名稱:ThinkUp,代碼行數:11,代碼來源:TestOfMailer.php

示例15: tearDown

 public function tearDown() {
     parent::tearDown();
     if(file_exists($this->backup_file)) {
         unlink($this->backup_file);
     }
     if(file_exists($this->backup_test)) {
         unlink($this->backup_test);
     }
     if(file_exists($this->backup_dir)) {
         unlink($this->backup_dir);
     }
 }
開發者ID:rkabir,項目名稱:ThinkUp,代碼行數:12,代碼來源:TestOfBackupController.php


注:本文中的ThinkUpUnitTestCase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。