public function tearDown()
 {
     parent::tearDown();
     $this->logger->close();
     //clear doesOwnerHaveAccessToPost query cache
     OwnerInstanceMySQLDAO::$post_access_query_cache = array();
 }
 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='*****@*****.**',\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++;
     }
 }
 public function tearDown()
 {
     $this->builders = null;
     parent::tearDown();
     $this->logger->close();
     $this->DAO = null;
 }
 public function tearDown()
 {
     $this->builder1 = null;
     $this->builder2 = null;
     $this->builder3 = null;
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->logger->close();
     // clear options cache
     PluginOptionMySQLDAO::$cached_options = array();
 }
 public function tearDown()
 {
     $this->builders = null;
     parent::tearDown();
     //make sure our db_type is set to the default...
     Config::getInstance()->setValue('db_type', 'mysql');
 }
 public function setUp()
 {
     parent::setUp();
     $webapp = Webapp::getInstance();
     $webapp->registerPlugin('twitter', 'TwitterPlugin');
     $webapp->registerPlugin('facebook', 'FacebookPlugin');
 }
 public function tearDown()
 {
     $this->builders = null;
     $this->logger->close();
     $this->instance = null;
     $this->api = null;
     parent::tearDown();
 }
 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');
 }
 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");
     }
 }
示例#11
0
 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);
     }
 }
 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();
 }
示例#13
0
 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);
     }
 }
示例#14
0
 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);
     }
 }
 public function tearDown()
 {
     parent::tearDown();
     $zipfile = FileDataManager::getBackupPath('.htthinkup_db_backup.zip');
     $backup_dir = FileDataManager::getBackupPath();
     if (file_exists($zipfile)) {
         unlink($zipfile);
     }
     if (file_exists($backup_dir)) {
         $this->recursiveDelete($backup_dir);
     }
 }
 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);
     }
     //set zip class requirement class name back
     BackupController::$zip_class_req = 'ZipArchive';
 }
    public function setUp()
    {
        parent::setUp();
        $session = new Session();
        $cryptpass = $session->pwdcrypt("oldpassword");
        $q = <<<SQL
INSERT INTO #prefix#owners SET
    id = 1,
    full_name = 'ThinkUp J. User',
    email = '*****@*****.**',
    pwd = '{$cryptpass}',
    activation_code='8888',
    is_activated =1
SQL;
        $this->testdb_helper->runSQL($q);
    }
 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');
     }
 }
 public function tearDown()
 {
     if (file_exists($this->export_test)) {
         unlink($this->export_test);
     }
     self::deleteFile('posts.tmp');
     self::deleteFile('links.tmp');
     self::deleteFile('encoded_locations.tmp');
     self::deleteFile('favorites.tmp');
     self::deleteFile('follows.tmp');
     self::deleteFile('follower_count.tmp');
     self::deleteFile('users_from_posts.tmp');
     self::deleteFile('users_followees.tmp');
     self::deleteFile('users_followers.tmp');
     //set zip class requirement class name back
     BackupController::$zip_class_req = 'ZipArchive';
     $this->builders = null;
     parent::tearDown();
 }
    public function setUp()
    {
        parent::setUp();
        $config = Config::getInstance();
        $config->setValue('debug', true);
        $session = new Session();
        $cryptpass = $session->pwdcrypt("oldpassword");
        $q = <<<SQL
INSERT INTO #prefix#owners SET
    id = 1,
    full_name = 'ThinkUp J. User',
    email = '*****@*****.**',
    pwd = '{$cryptpass}',
    activation_code='8888',
    is_activated =1
SQL;
        $this->db->exec($q);
        $dao = DAOFactory::getDAO('OwnerDAO');
        $this->owner = $dao->getByEmail('*****@*****.**');
        $this->token = $this->owner->setPasswordRecoveryToken();
    }
示例#21
0
    public function tearDown(){
        parent::tearDown();
        $config = Config::getInstance();
        //reset app version
        $config->setValue('THINKUP_VERSION', $this->init_db_version);

        /** delete files if needed **/
        // delete token
        if(file_exists($this->token_file)) {
            unlink($this->token_file);
        }
        // delete migration test files
        if(isset($this->test_migrations) && count($this->test_migrations) > 0) {
            foreach($this->test_migrations as $file) {
                if(file_exists($file)) {
                    unlink($file);
                }
            }
            $this->test_migrations = array();
        }
    }
 public function tearDown()
 {
     Config::destroyInstance();
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     StreamMessageQueueFactory::$queue = null;
 }
 public function tearDown()
 {
     parent::tearDown();
 }
示例#25
0
 public function tearDown()
 {
     parent::tearDown();
     $this->logger->close();
 }
示例#26
0
 public function tearDown()
 {
     $this->builders = null;
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $_SERVER['HTTP_HOST'] = 'http://localhost';
     ThinkUpAuthAPIController::$owner = false;
 }
 public function tearDown()
 {
     $this->dao = null;
     parent::tearDown();
 }
示例#29
0
 public function tearDown()
 {
     $config = Config::getInstance();
     $config->setValue('use_db_sessions', true);
     parent::tearDown();
 }
示例#30
0
 public function setUp()
 {
     parent::setUp();
     $webapp = Webapp::getInstance();
     $webapp->registerPlugin('embedthread', 'EmbedThreadPlugin');
 }