本文整理汇总了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');
}
}
示例2: tearDown
public function tearDown()
{
parent::tearDown();
$this->logger->close();
//clear doesOwnerHaveAccessToPost query cache
OwnerInstanceMySQLDAO::$post_access_query_cache = array();
}
示例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++;
}
}
示例4: tearDown
public function tearDown()
{
$this->builders = null;
parent::tearDown();
$this->logger->close();
$this->DAO = null;
}
示例5: tearDown
public function tearDown()
{
$this->builder1 = null;
$this->builder2 = null;
$this->builder3 = null;
parent::tearDown();
}
示例6: tearDown
public function tearDown()
{
parent::tearDown();
$this->logger->close();
// clear options cache
PluginOptionMySQLDAO::$cached_options = array();
}
示例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');
}
示例8: setUp
public function setUp()
{
parent::setUp();
$webapp = Webapp::getInstance();
$webapp->registerPlugin('twitter', 'TwitterPlugin');
$webapp->registerPlugin('facebook', 'FacebookPlugin');
}
示例9: tearDown
public function tearDown()
{
$this->builders = null;
$this->logger->close();
$this->instance = null;
$this->api = null;
parent::tearDown();
}
示例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');
}
示例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");
}
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
}