コード例 #1
0
 public function testSuccessfulLogin()
 {
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('mypassword', 'test');
     $builder = FixtureBuilder::build('owners', array('id' => 1, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'pwd_salt' => 'test', 'is_activated' => 1, 'is_admin' => 1));
     //CLI
     $controller = new StreamerAuthController(2, array('stream', '*****@*****.**', 'mypassword'));
     $this->assertTrue(isset($controller));
     $results = $controller->go();
     $this->debug($results);
     $this->assertNoPattern('/ERROR: Invalid or missing username and password./', $results);
 }
コード例 #2
0
 protected function buildData()
 {
     $builders = array();
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("secretpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'is_activated' => 1, 'is_admin' => 1, 'api_key_private' => 'aabbccdd'));
     $test_salt = 'test_salt';
     $password = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('secretpassword', $test_salt);
     $builders[] = FixtureBuilder::build('owners', array('id' => 2, 'email' => '*****@*****.**', 'pwd' => $password, 'pwd_salt' => $test_salt, 'is_activated' => 1, 'is_admin' => 1, 'api_key_private' => ''));
     $builders[] = FixtureBuilder::build('owners', array('id' => 3, 'email' => '*****@*****.**', 'pwd' => $password, 'pwd_salt' => $test_salt, 'is_activated' => 0, 'is_admin' => 0));
     $builders[] = FixtureBuilder::build('owners', array('id' => 4, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'is_activated' => 1, 'is_admin' => 0, 'api_key_private' => 'yayaya'));
     return $builders;
 }
コード例 #3
0
 protected function buildData()
 {
     $builders = array();
     $saltedpass = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('oldpassword', 'testsalt');
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("oldpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'activation_code' => '8888', 'is_activated' => 1));
     $builders[] = FixtureBuilder::build('owners', array('id' => 2, 'full_name' => 'Salted User', 'email' => '*****@*****.**', 'pwd' => $saltedpass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'activation_code' => '8888', 'is_activated' => 1));
     $dao = DAOFactory::getDAO('OwnerDAO');
     $this->owner = $dao->getByEmail('*****@*****.**');
     $this->token = $this->owner->setPasswordRecoveryToken();
     $this->owner_salt = $dao->getByEmail('*****@*****.**');
     $this->token_salt = $this->owner_salt->setPasswordRecoveryToken();
     return $builders;
 }
コード例 #4
0
 public function testAlreadyLoggedIn()
 {
     $owner_dao = new OwnerMySQLDAO();
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("secretpassword");
     $owner = array('id' => 1, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'is_activated' => 1, 'pwd_salt' => OwnerMySQLDAO::$default_salt);
     $builder1 = FixtureBuilder::build('owners', $owner);
     $instance = array('id' => 1, 'network_username' => 'thinkupapp');
     $builder2 = FixtureBuilder::build('instances', $instance);
     $owner_instance = array('owner_id' => 1, 'instance_id' => 1);
     $builder3 = FixtureBuilder::build('owner_instances', $owner_instance);
     $this->simulateLogin('*****@*****.**');
     $controller = new RegisterController(true);
     $results = $controller->go();
     $this->assertPattern("/thinkupapp's Dashboard | ThinkUp/", $results);
 }
コード例 #5
0
 public function setUp()
 {
     parent::setUp();
     new ExportMySQLDAO();
     $this->config = Config::getInstance();
     $this->pdo = ExportMySQLDAO::$PDO;
     $this->export_test = THINKUP_WEBAPP_PATH . BackupDAO::CACHE_DIR . '/thinkup_user_export_test.zip';
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("secretpassword");
     $owner = array('id' => 1, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'is_activated' => 1, 'is_admin' => 1, 'pwd_salt' => OwnerMySQLDAO::$default_salt);
     $this->builders[] = FixtureBuilder::build('owners', $owner);
     $instance = array('id' => 1, 'network_username' => 'test_user', 'network' => 'twitter');
     $this->builders[] = FixtureBuilder::build('instances', $instance);
     $owner_instance = array('owner_id' => 1, 'instance_id' => 1);
     $this->builders[] = FixtureBuilder::build('owner_instances', $owner_instance);
     $this->builders[] = FixtureBuilder::build('users', array('user_id' => 10, 'network' => 'twitter', 'user_name' => 'test_user'));
 }
コード例 #6
0
 /**
  * Set up necessary owner, instance, user, and owner_instance data to see fully-rendered insight markup
  * on debug.
  * @param Instance $instance Must have id, network, and network_username set
  * @return arr FixtureBuilders
  */
 protected function setUpPublicInsight(Instance $instance)
 {
     if (!isset($instance->network_user_id)) {
         $instance->network_user_id = '1001';
     }
     $builders = array();
     //Owner
     $pwd = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('pwd3', 'salt');
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'pwd' => $pwd, 'pwd_salt' => 'salt'));
     //Public instance
     $builders[] = FixtureBuilder::build('instances', array('id' => $instance->id, 'network_user_id' => $instance->network_user_id, 'network_username' => $instance->network_username, 'network' => $instance->network, 'network_viewer_id' => '10', 'crawler_last_run' => '1988-01-20 12:00:00', 'is_active' => 1, 'is_public' => 1, 'posts_per_day' => 11, 'posts_per_week' => 77));
     //Owner instance
     $builders[] = FixtureBuilder::build('owner_instances', array('instance_id' => $instance->id, 'owner_id' => 1));
     //User
     $builders[] = FixtureBuilder::build('users', array('user_id' => $instance->network_user_id, 'network' => $instance->network));
     return $builders;
 }
コード例 #7
0
 protected function buildData()
 {
     $builders = array();
     //Add owner
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("oldpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'api_key' => 'c9089f3c9adaf0186f6ffb1ee8d6501c', 'email_notification_frequency' => 'daily', 'timezone' => 'UTC'));
     $builders[] = FixtureBuilder::build('owners', array('id' => 2, 'full_name' => 'ThinkUp J. Admin', 'email' => '*****@*****.**', 'is_activated' => 1, 'is_admin' => 1));
     //Add instance_owner
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 1, 'instance_id' => 1));
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 2, 'instance_id' => 1));
     //Insert test data into test table
     $builders[] = FixtureBuilder::build('users', array('user_id' => 13, 'user_name' => 'ev', 'full_name' => 'Ev Williams'));
     //Make public
     //Insert test data into test table
     $builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_user_id' => 13, 'network_username' => 'ev', 'is_public' => 1, 'network' => 'twitter'));
     return $builders;
 }
コード例 #8
0
 /**
  * Test getPassword
  */
 public function testGetPassword()
 {
     //owner who doesn't exist
     $result = $this->DAO->getPass('*****@*****.**');
     $this->assertFalse($result);
     //owner who is not activated
     $result = $this->DAO->getPass('*****@*****.**');
     $this->assertFalse($result);
     //activated owner
     $result = $this->DAO->getPass('*****@*****.**');
     $this->assertEqual($result, ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod('pwd2'));
 }
コード例 #9
0
 protected function buildData()
 {
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("oldpassword");
     $builder = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'activation_code' => 8888, 'is_activated' => 1, 'pwd_salt' => OwnerMySQLDAO::$default_salt));
     return $builder;
 }
コード例 #10
0
 public function testFailedLoginLockout()
 {
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("blah");
     $owner = array('id' => 2, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'is_activated' => 1);
     $builder = FixtureBuilder::build('owners', $owner);
     //force login lockout by providing the wrong password more than 10 times
     $i = 1;
     while ($i <= 11) {
         $_POST['Submit'] = 'Log In';
         $_POST['email'] = '*****@*****.**';
         $_POST['pwd'] = 'blah1';
         $controller = new LoginController(true);
         $results = $controller->go();
         $v_mgr = $controller->getViewManager();
         $this->assertEqual($v_mgr->getTemplateDataItem('controller_title'), 'Log in');
         $owner = $this->DAO->getByEmail('*****@*****.**');
         if ($i < 10) {
             $this->assertPattern("/Hmm, that password seems wrong./", $v_mgr->getTemplateDataItem('error_msg'));
             $this->assertEqual($owner->failed_logins, $i);
         } else {
             $this->assertEqual("Inactive account. Account deactivated due to too many failed logins. " . '<a href=\\"forgot.php\\">Reset your password.</a>', $v_mgr->getTemplateDataItem('error_msg'));
             $this->assertEqual($owner->account_status, "Account deactivated due to too many failed logins");
         }
         $i = $i + 1;
     }
 }
コード例 #11
0
 public function testOfLoggedInServiceUsersNoInsights()
 {
     //set up owner
     $pwd1 = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('pwd3', 'salt');
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'pwd' => $pwd1, 'pwd_salt' => OwnerMySQLDAO::$default_salt));
     //set up instance
     $builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_user_id' => '10', 'network_username' => 'jack', 'network' => 'twitter', 'network_viewer_id' => '10', 'crawler_last_run' => '1988-01-20 12:00:00', 'is_active' => 1, 'is_public' => 1, 'posts_per_day' => 11, 'posts_per_week' => 77));
     //set up owner instances
     $builders[] = FixtureBuilder::build('owner_instances', array('instance_id' => 1, 'owner_id' => 1));
     $this->simulateLogin('*****@*****.**', false);
     $controller = new InsightStreamController();
     $results = $controller->go();
     $this->assertNoPattern('/Email/', $results);
     $this->assertNoPattern('/Password/', $results);
     //don't show insights
     $this->assertNoPattern('/Hey these are some local followers!/', $results);
     $this->assertNoPattern('/Retweet spike! Jill\'s post privately got retweeted 110 times/', $results);
     $this->assertNoPattern('/Set up a/', $results);
     $this->assertPattern('/Check back later/', $results);
     $this->assertPattern('/update your ThinkUp data now/', $results);
     $this->debug($results);
 }
コード例 #12
0
 /**
  * Insert some test data to navigate the app
  */
 protected function buildData()
 {
     $builders = array();
     //Add owner
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("secretpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'is_activated' => 1, 'is_admin' => 1, 'pwd_salt' => OwnerMySQLDAO::$default_salt));
     $builders[] = FixtureBuilder::build('owners', array('id' => 2, 'email' => '*****@*****.**', 'pwd' => $hashed_pass, 'is_activated' => 1, 'is_admin' => 0, 'pwd_salt' => OwnerMySQLDAO::$default_salt));
     //Add instances
     $builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_user_id' => 17, 'network_username' => 'thinkupapp', 'is_public' => 1, 'network' => 'twitter', 'crawler_last_run' => '-31d'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 2, 'network_user_id' => 13, 'network_username' => 'ev', 'is_public' => 1, 'network' => 'twitter', 'crawler_last_run' => '-31d'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 3, 'network_user_id' => 18, 'network_username' => 'shutterbug', 'is_public' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 4, 'network_user_id' => 19, 'network_username' => 'linkbaiter', 'is_public' => 1, 'network' => 'twitter'));
     //Add instance_owner
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 1, 'instance_id' => 1));
     //Insert test data into test table
     $builders[] = FixtureBuilder::build('users', array('user_id' => 12, 'user_name' => 'jack', 'full_name' => 'Jack Dorsey', 'avatar' => 'avatar.jpg', 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 13, 'user_name' => 'ev', 'full_name' => 'Ev Williams', 'avatar' => 'avatar.jpg', 'last_updated' => '1/1/2005', 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 16, 'user_name' => 'private', 'full_name' => 'Private Poster', 'avatar' => 'avatar.jpg', 'is_protected' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 17, 'user_name' => 'thinkupapp', 'full_name' => 'ThinkUpers', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 18, 'user_name' => 'shutterbug', 'full_name' => 'Shutter Bug', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 19, 'user_name' => 'linkbaiter', 'full_name' => 'Link Baiter', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('user_errors', array('user_id' => 15, 'error_code' => 404, 'error_text' => 'User not found', 'error_issued_to_user_id' => 13));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 13, 'follower_id' => 12));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 13, 'follower_id' => 14));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 13, 'follower_id' => 15));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 13, 'follower_id' => 16));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 16, 'follower_id' => 12));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 19, 'follower_id' => 13));
     $builders[] = FixtureBuilder::build('follows', array('user_id' => 18, 'follower_id' => 13));
     $counter = 1;
     while ($counter < 40) {
         $reply_or_forward_count = $counter + 200;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $builders[] = FixtureBuilder::build('posts', array('id' => $counter, 'post_id' => $counter, 'author_user_id' => 13, 'author_username' => 'ev', 'author_fullname' => 'Ev Williams', 'author_avatar' => 'avatar.jpg', 'source' => 'web', 'pub_date' => "2006-01-01 00:{$pseudo_minute}:00", 'reply_count_cache' => $reply_or_forward_count, 'retweet_count_cache' => $reply_or_forward_count, 'post_text' => 'This is post ' . $counter, 'network' => 'twitter', 'is_protected' => 0, 'is_geo_encoded' => 1));
         $counter++;
     }
     $counter = 0;
     while ($counter < 40) {
         $post_id = $counter + 40;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $builders[] = FixtureBuilder::build('posts', array('id' => $post_id, 'post_id' => $post_id, 'author_user_id' => 18, 'author_username' => 'shutterbug', 'author_fullname' => 'Shutter Bug', 'author_avatar' => 'avatar.jpg', 'source' => 'web', 'pub_date' => "2006-01-02 00:{$pseudo_minute}:00", 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'post_text' => 'This is image post ' . $counter, 'network' => 'twitter', 'is_protected' => 0));
         $builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/' . $counter, 'expanded_url' => 'http://example.com/' . $counter . 'jpg', 'title' => '', 'clicks' => 0, 'post_key' => $post_id, 'image_src' => 'image.png'));
         $counter++;
     }
     $counter = 0;
     while ($counter < 40) {
         $post_id = $counter + 80;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $builders[] = FixtureBuilder::build('posts', array('id' => $post_id, 'post_id' => $post_id, 'author_user_id' => 19, 'author_username' => 'linkbaiter', 'author_fullname' => 'Link Baiter', 'author_avatar' => 'avatar.jpg', 'post_text' => 'This is link post ' . $counter, 'source' => 'web', 'pub_date' => "2006-03-01 00:{$pseudo_minute}:00", 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'network' => 'twitter', 'is_protected' => 0));
         $builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/' . $counter, 'expanded_url' => 'http://example.com/' . $counter . 'html', 'title' => 'Link ' . $counter, 'clicks' => 0, 'post_key' => $post_id, 'image_src' => ''));
         $counter++;
     }
     $counter = 0;
     while ($counter < 10) {
         $post_id = $counter + 120;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $builders[] = FixtureBuilder::build('posts', array('post_id' => $post_id, 'author_user_id' => 1234, 'author_username' => 'thinkupapp', 'author_fullname' => 'thinkupapp', 'author_avatar' => 'avatar.jpg', 'post_text' => 'This is test post ' . $counter, 'source' => 'web', 'pub_date' => "2006-03-01 00:{$pseudo_minute}:00", 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'network' => 'twitter'));
         $counter++;
     }
     return $builders;
 }
コード例 #13
0
 private function buildPublicStreamInsights()
 {
     $builders = array();
     //owner
     $salt = 'salt';
     $pwd1 = ThinkUpTestLoginHelper::hashPasswordUsingCurrentMethod('pwd3', $salt);
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'pwd' => $pwd1, 'pwd_salt' => OwnerMySQLDAO::$default_salt));
     //public instance
     $builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_user_id' => '10', 'network_username' => 'jack', 'network' => 'twitter', 'network_viewer_id' => '10', 'crawler_last_run' => '1988-01-20 12:00:00', 'is_active' => 1, 'is_public' => 1, 'posts_per_day' => 11, 'posts_per_week' => 77));
     //owner instances
     $builders[] = FixtureBuilder::build('owner_instances', array('instance_id' => 1, 'owner_id' => 1));
     //public insights
     $time_now = date("Y-m-d H:i:s");
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-05-01', 'slug' => 'avg_replies_per_week', 'instance_id' => '1', 'headline' => 'Booyah!', 'text' => 'Hey these are some local followers!', 'emphasis' => Insight::EMPHASIS_HIGH, 'filename' => 'localfollowers', 'time_generated' => $time_now, 'related_data' => self::getRelatedDataListOfUsers(), 'header_image' => 'http://example.com/header_image.gif'));
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-06-01', 'slug' => 'avg_replies_per_week', 'instance_id' => '1', 'headline' => 'Booyah!', 'text' => 'This is a list of posts!', 'emphasis' => Insight::EMPHASIS_HIGH, 'filename' => 'favoriteflashbacks', 'time_generated' => $time_now, 'related_data' => self::getRelatedDataListOfPosts()));
     return $builders;
 }
コード例 #14
0
 private function buildSearchData1()
 {
     $builders = array();
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("oldpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. Admin', 'email' => '*****@*****.**', 'is_activated' => 1, 'is_admin' => 1));
     $builders[] = FixtureBuilder::build('owners', array('id' => 2, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'api_key' => 'c9089f3c9adaf0186f6ffb1ee8d6501c'));
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 1, 'instance_id' => 1));
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 1, 'instance_id' => 2));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 100, 'user_name' => 'ecucurella', 'full_name' => 'Eduard Cucurella'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 101, 'user_name' => 'vetcastellnou', 'full_name' => 'Veterans Castellnou'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 1, 'network_user_id' => '100', 'network_username' => 'ecucurella', 'is_public' => 1, 'is_active' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 2, 'network_user_id' => '101', 'network_username' => 'vetcastellnou', 'is_public' => 1, 'is_active' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('hashtags', array('hashtag' => '#totssomtv3', 'network' => 'twitter', 'count_cache' => 0));
     $builders[] = FixtureBuilder::build('hashtags', array('hashtag' => 'CCMA', 'network' => 'twitter', 'count_cache' => 0));
     $builders[] = FixtureBuilder::build('hashtags', array('hashtag' => '#efectivament', 'network' => 'twitter', 'count_cache' => 0));
     $builders[] = FixtureBuilder::build('hashtags', array('hashtag' => 'tv3', 'network' => 'twitter', 'count_cache' => 0));
     $builders[] = FixtureBuilder::build('instances_hashtags', array('instance_id' => 1, 'hashtag_id' => 1, 'last_post_id' => '0', 'earliest_post_id' => 0));
     $builders[] = FixtureBuilder::build('instances_hashtags', array('instance_id' => 1, 'hashtag_id' => 2, 'last_post_id' => '0', 'earliest_post_id' => 0));
     $builders[] = FixtureBuilder::build('instances_hashtags', array('instance_id' => 1, 'hashtag_id' => 3, 'last_post_id' => '0', 'earliest_post_id' => 0));
     $builders[] = FixtureBuilder::build('instances_hashtags', array('instance_id' => 1, 'hashtag_id' => 4, 'last_post_id' => '0', 'earliest_post_id' => 0));
     $builders[] = FixtureBuilder::build('hashtags_posts', array('post_id' => 1, 'hashtag_id' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('hashtags_posts', array('post_id' => 2, 'hashtag_id' => 2, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('hashtags_posts', array('post_id' => 3, 'hashtag_id' => 3, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('hashtags_posts', array('post_id' => 4, 'hashtag_id' => 4, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => '1', 'author_user_id' => '100', 'author_username' => 'ecucurella', 'author_fullname' => 'Eduard Cucurella', 'author_avatar' => 'http://aa.com', 'author_follower_count' => 0, 'post_text' => 'Dem treballadors de TV3 donarem sang #lasangdelatele #totssomtv3', 'is_protected' => 0, 'source' => '<a href=""></a>', 'location' => 'BCN', 'place' => '', 'place_id' => '', 'geo' => '', 'pub_date' => '2013-02-28 11:02:34', 'in_reply_to_user_id' => '', 'in_reply_to_post_id' => '', 'reply_count_cache' => 1, 'is_reply_by_friend' => 0, 'in_retweet_of_post_id' => '', 'old_retweet_count_cache' => 0, 'is_retweet_by_friend' => 0, 'reply_retweet_distance' => 0, 'network' => 'twitter', 'is_geo_encoded' => 0, 'in_rt_of_user_id' => '', 'retweet_count_cache' => 0, 'retweet_count_api' => 0, 'favlike_count_cache' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => '2', 'author_user_id' => '101', 'author_username' => 'vetcastellnou', 'author_fullname' => 'Veterans Castellnou', 'author_avatar' => 'http://aa.com', 'author_follower_count' => 0, 'post_text' => 'El comit dempresa de TV3 acusa la direcci de la CCMA de populista', 'is_protected' => 0, 'source' => '<a href=""></a>', 'location' => 'BCN', 'place' => '', 'place_id' => '', 'geo' => '', 'pub_date' => '2013-02-28 11:02:34', 'in_reply_to_user_id' => '', 'in_reply_to_post_id' => '', 'reply_count_cache' => 1, 'is_reply_by_friend' => 0, 'in_retweet_of_post_id' => '', 'old_retweet_count_cache' => 0, 'is_retweet_by_friend' => 0, 'reply_retweet_distance' => 0, 'network' => 'twitter', 'is_geo_encoded' => 0, 'in_rt_of_user_id' => '', 'retweet_count_cache' => 0, 'retweet_count_api' => 0, 'favlike_count_cache' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => '3', 'author_user_id' => '100', 'author_username' => 'ecucurella', 'author_fullname' => 'Eduard Cucurella', 'author_avatar' => 'http://aa.com', 'author_follower_count' => 0, 'post_text' => 'El Chelsea quiere a Mourinho YA #efectivament', 'is_protected' => 0, 'source' => '<a href=""></a>', 'location' => 'BCN', 'place' => '', 'place_id' => '', 'geo' => '', 'pub_date' => '2013-02-28 11:02:34', 'in_reply_to_user_id' => '', 'in_reply_to_post_id' => '', 'reply_count_cache' => 1, 'is_reply_by_friend' => 0, 'in_retweet_of_post_id' => '', 'old_retweet_count_cache' => 0, 'is_retweet_by_friend' => 0, 'reply_retweet_distance' => 0, 'network' => 'twitter', 'is_geo_encoded' => 0, 'in_rt_of_user_id' => '', 'retweet_count_cache' => 0, 'retweet_count_api' => 0, 'favlike_count_cache' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => '4', 'author_user_id' => '101', 'author_username' => 'vetcastellnou', 'author_fullname' => 'Veterans Castellnou', 'author_avatar' => 'http://aa.com', 'author_follower_count' => 0, 'post_text' => 'El comit dempresa de TV3 acusa la direcci de la CCMA de populista', 'is_protected' => 0, 'source' => '<a href=""></a>', 'location' => 'BCN', 'place' => '', 'place_id' => '', 'geo' => '', 'pub_date' => '2013-02-28 11:02:34', 'in_reply_to_user_id' => '', 'in_reply_to_post_id' => '', 'reply_count_cache' => 1, 'is_reply_by_friend' => 0, 'in_retweet_of_post_id' => '', 'old_retweet_count_cache' => 0, 'is_retweet_by_friend' => 0, 'reply_retweet_distance' => 0, 'network' => 'twitter', 'is_geo_encoded' => 0, 'in_rt_of_user_id' => '', 'retweet_count_cache' => 0, 'retweet_count_api' => 0, 'favlike_count_cache' => 0));
     return $builders;
 }
コード例 #15
0
 protected function buildData()
 {
     $builders = array();
     $hashed_pass = ThinkUpTestLoginHelper::hashPasswordUsingDeprecatedMethod("oldpassword");
     $builders[] = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => '*****@*****.**', 'is_activated' => 1, 'is_admin' => 1, 'pwd' => $hashed_pass, 'pwd_salt' => OwnerMySQLDAO::$default_salt, 'api_key' => 'c9089f3c9adaf0186f6ffb1ee8d6501c'));
     $builders[] = FixtureBuilder::build('instances', array('id' => 1));
     $builders[] = FixtureBuilder::build('owner_instances', array('owner_id' => 1, 'instance_id' => 1));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 13, 'user_name' => 'ev', 'full_name' => 'Ev Williams', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'last_updated' => '2005-01-01 13:48:05', 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 14, 'user_name' => 'jane', 'full_name' => 'jane mcnulty', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'last_updated' => '2005-01-01 13:48:05', 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 18, 'user_name' => 'shutterbug', 'full_name' => 'Shutter Bug', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 10, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 19, 'user_name' => 'linkbaiter', 'full_name' => 'Link Baiter', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 15, 'network' => 'twitter', 'last_updated' => '2010-03-02 13:45:55'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 20, 'user_name' => 'user1', 'full_name' => 'User 1', 'avatar' => 'avatar.jpg', 'is_protected' => 0, 'follower_count' => 120, 'network' => 'twitter'));
     //protected user
     $builders[] = FixtureBuilder::build('users', array('user_id' => 21, 'user_name' => 'user2', 'full_name' => 'User 2', 'avatar' => 'avatar.jpg', 'is_protected' => 1, 'follower_count' => 80, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 22, 'user_name' => 'quoter', 'full_name' => 'Quotables', 'is_protected' => 0, 'follower_count' => 80, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 23, 'user_name' => 'user3', 'full_name' => 'User 3', 'is_protected' => 0, 'follower_count' => 100, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('users', array('user_id' => 24, 'user_name' => 'notonpublictimeline', 'full_name' => 'Not on Public Timeline', 'is_protected' => 1, 'network' => 'twitter', 'follower_count' => 100));
     //Make public
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 13, 'network_username' => 'ev', 'is_public' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 18, 'network_username' => 'shutterbug', 'is_public' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 19, 'network_username' => 'linkbaiter', 'is_public' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 23, 'network_username' => 'user3', 'is_public' => 1, 'network' => 'twitter'));
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 24, 'network_username' => 'notonpublictimeline', 'is_public' => 0, 'network' => 'twitter'));
     //public on originating network, private on TU
     $builders[] = FixtureBuilder::build('instances', array('network_user_id' => 14, 'network_username' => 'jane', 'is_public' => 0, 'network' => 'twitter'));
     //Add straight text posts
     $counter = 0;
     while ($counter < 40) {
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         if ($counter % 3 == 0) {
             $source = '<a href="http://twitter.com" rel="nofollow">Tweetie for Mac</a>';
         } else {
             if ($counter % 3 == 1) {
                 $source = '<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>';
             } else {
                 $source = 'web';
             }
         }
         $builders[] = FixtureBuilder::build('posts', array('post_id' => $counter, 'author_user_id' => 13, 'author_username' => 'ev', 'author_fullname' => 'Ev Williams', 'author_avatar' => 'avatar.jpg', 'post_text' => 'This is post ' . $counter, 'source' => $source, 'pub_date' => '2006-01-01 00:' . $pseudo_minute . ':00', 'reply_count_cache' => rand(0, 4), 'retweet_count_cache' => 5, 'network' => 'twitter', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_post_id' => null, 'in_retweet_of_post_id' => null, 'is_geo_encoded' => 0, 'is_protected' => 0));
         $counter++;
     }
     //Add photo posts from Flickr
     $counter = 0;
     while ($counter < 40) {
         $post_id = $counter + 40;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $source = rand(0, 1) == 0 ? 'Flickr' : 'Picasa';
         $protected = $counter % 2 == 1 ? 1 : 0;
         $builders[] = FixtureBuilder::build('posts', array('post_id' => $post_id, 'network' => 'twitter', 'author_user_id' => 18, 'author_username' => 'shutterbug', 'author_fullname' => 'Shutter Bug', 'author_avatar' => 'avatar.jpg', 'post_text' => 'This is image post ' . $counter, 'source' => $source, 'in_reply_to_post_id' => null, 'in_retweet_of_post_id' => null, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'pub_date' => '2006-01-02 00:' . $pseudo_minute . ':00', 'network' => 'twitter', 'is_geo_encoded' => 0, 'is_protected' => $protected));
         $builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/' . $counter, 'expanded_url' => 'http://example.com/' . $counter . '.jpg', 'title' => '', 'clicks' => 0, 'post_key' => $post_id, 'image_src' => 'image.png'));
         $counter++;
     }
     //Add link posts
     $counter = 0;
     while ($counter < 40) {
         $post_id = $counter + 80;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         $builders[] = FixtureBuilder::build('posts', array('post_id' => $post_id, 'author_user_id' => 19, 'author_username' => 'linkbaiter', 'author_fullname' => 'Link Baiter', 'is_geo_encoded' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'post_text' => 'This is link post ' . $counter, 'source' => 'web', 'pub_date' => '2006-03-01 00:' . $pseudo_minute . ':00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'network' => 'twitter', 'is_protected' => 0));
         $builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/' . $post_id . '', 'explanded_url' => 'http://example.com/' . $counter . '.html', 'title' => 'Link ' . $counter, 'clicks' => 0, 'post_key' => $post_id, 'image_src' => ''));
         $counter++;
     }
     //Add mentions
     $counter = 0;
     while ($counter < 10) {
         $post_id = $counter + 120;
         $pseudo_minute = str_pad($counter, 2, "0", STR_PAD_LEFT);
         if ($counter / 2 == 0) {
             $builders[] = FixtureBuilder::build('posts', array('post_id' => $post_id, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'in_reply_to_post_id' => null, 'in_retweet_of_post_id' => null, 'is_geo_encoded' => 0, 'network' => 'twitter', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'post_text' => 'Hey @ev and @jack thanks for founding Twitter post ' . $counter, 'pub_date' => '2006-03-01 00:' . $pseudo_minute . ':00', 'location' => 'New Delhi', 'is_protected' => 0));
         } else {
             $builders[] = FixtureBuilder::build('posts', array('post_id' => $post_id, 'author_user_id' => 21, 'author_username' => 'user2', 'author_fullname' => 'User 2', 'in_reply_to_post_id' => null, 'in_retweet_of_post_id' => null, 'is_geo_encoded' => 0, 'network' => 'twitter', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'post_text' => 'Hey @ev and @jack should fix Twitter - post ' . $counter, 'pub_date' => '2006-03-01 00:' . $pseudo_minute . ':00', 'place' => 'New Delhi', 'is_protected' => 0));
         }
         $counter++;
     }
     //Add replies to specific post
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 131, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'author_follower_count' => 120, 'network' => 'twitter', 'post_text' => '@shutterbug Nice shot!', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 3, 'retweet_count_cache' => 0, 'in_reply_to_post_id' => 41, 'in_reply_to_user_id' => 18, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'location' => 'New Delhi, Delhi, India', 'reply_retweet_distance' => 0, 'is_geo_encoded' => 1, 'is_protected' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 132, 'author_user_id' => 21, 'author_username' => 'user2', 'author_fullname' => 'User 2', 'network' => 'twitter', 'post_text' => '@shutterbug Nice shot!', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'in_reply_to_post_id' => 41, 'in_reply_to_user_id' => 18, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'location' => 'Chennai, Tamil Nadu, India', 'reply_retweet_distance' => 2000, 'is_geo_encoded' => 1, 'is_protected' => 1));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 133, 'author_user_id' => 19, 'author_username' => 'linkbaiter', 'author_fullname' => 'Link Baiter', 'author_follower_count' => 15, 'network' => 'twitter', 'post_text' => '@shutterbug This is a link post reply http://example.com/', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'in_reply_to_post_id' => 41, 'in_reply_to_user_id' => 18, 'location' => 'Mumbai, Maharashtra, India', 'reply_retweet_distance' => 1500, 'is_geo_encoded' => 1, 'is_protected' => 0));
     $builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com', 'expanded_url' => 'http://example.com/expanded-link.html', 'title' => 'Link 1', 'clicks' => 0, 'post_id' => 133, 'image_src' => ''));
     //Add retweets of a specific post
     //original post
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 134, 'author_user_id' => 22, 'author_username' => 'quoter', 'author_fullname' => 'Quoter of Quotables', 'network' => 'twitter', 'post_text' => 'Be liberal in what you accept and conservative in what you send', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 2, 'retweet_count_cache' => 3, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308,77.22496', 'is_geo_encoded' => 1, 'is_protected' => 0));
     // original post 2
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 148, 'author_user_id' => 22, 'author_username' => 'quoter', 'author_fullname' => 'Quoter of Quotables', 'network' => 'twitter', 'post_text' => 'The cake is a lie.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 2, 'retweet_count_cache' => 3, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308,77.22496', 'is_geo_encoded' => 1, 'is_protected' => 0));
     //retweet 1
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 135, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => 'RT @quoter Be liberal in what you accept and conservative in what you send', 'source' => 'web', 'pub_date' => '2006-03-01 00:01:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => 22, 'in_retweet_of_post_id' => 134, 'location' => 'Chennai, Tamil Nadu, India', 'geo' => '13.060416,80.249634', 'reply_retweet_distance' => 2000, 'is_geo_encoded' => 1, 'in_reply_to_post_id' => null, 'is_protected' => 0));
     //retweet 2
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 136, 'author_user_id' => 21, 'author_username' => 'user2', 'author_fullname' => 'User 2', 'network' => 'twitter', 'post_text' => 'RT @quoter Be liberal in what you accept and conservative in what you send', 'source' => 'web', 'pub_date' => '2006-03-01 00:02:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => 22, 'in_retweet_of_post_id' => 134, 'location' => 'Dwarka, New Delhi, Delhi, India', 'geo' => '28.635308,77.22496', 'reply_retweet_distance' => '0', 'is_geo_encoded' => 1, 'is_protected' => 0));
     //retweet 3
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 137, 'author_user_id' => 19, 'author_username' => 'linkbaiter', 'author_fullname' => 'Link Baiter', 'network' => 'twitter', 'post_text' => 'RT @quoter Be liberal in what you accept and conservative in what you send', 'source' => 'web', 'pub_date' => '2006-03-01 00:03:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => 22, 'in_retweet_of_post_id' => 134, 'location' => 'Mumbai, Maharashtra, India', 'geo' => '19.017656,72.856178', 'reply_retweet_distance' => 1500, 'is_geo_encoded' => 1, 'is_protected' => 0));
     //retweet 4
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 149, 'author_user_id' => 19, 'author_username' => 'linkbaiter', 'author_fullname' => 'Link Baiter', 'network' => 'twitter', 'post_text' => 'RT @quoter The cake is a lie.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => 22, 'in_retweet_of_post_id' => 148, 'location' => 'Mumbai, Maharashtra, India', 'geo' => '19.017656,72.856178', 'reply_retweet_distance' => 1500, 'is_geo_encoded' => 1, 'is_protected' => 0));
     //Add reply back
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 138, 'author_user_id' => 18, 'author_username' => 'shutterbug', 'author_fullname' => 'Shutterbug', 'network' => 'twitter', 'post_text' => '@user2 Thanks!', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'in_reply_to_user_id' => 21, 'in_reply_to_post_id' => 132, 'is_protected' => 0));
     //Add user exchange
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 139, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@ev When will Twitter have a business model?', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_post_id' => null, 'in_reply_to_user_id' => 13, 'is_protected' => 1));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 140, 'author_user_id' => 13, 'author_username' => 'ev', 'author_fullname' => 'Ev Williams', 'network' => 'twitter', 'post_text' => '@user1 Soon...', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'in_reply_to_user_id' => 20, 'in_reply_to_post_id' => 139, 'is_protected' => 0));
     //Add posts replying to post not in the system
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 141, 'author_user_id' => 23, 'author_username' => 'user3', 'author_fullname' => 'User 3', 'network' => 'twitter', 'post_text' => '@user4 I\'m replying to a post not in the TT db', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_user_id' => 20, 'in_reply_to_post_id' => 250, 'is_protected' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 142, 'author_user_id' => 23, 'author_username' => 'user3', 'author_fullname' => 'User 3', 'network' => 'twitter', 'post_text' => '@user4 I\'m replying to another post not in the TT db', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_user_id' => 20, 'in_reply_to_post_id' => 251, 'is_protected' => 0));
     //Add post by instance not on public timeline
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 143, 'author_user_id' => 24, 'author_username' => 'notonpublictimeline', 'author_fullname' => 'Not on public timeline', 'network' => 'twitter', 'post_text' => 'This post should not be on the public timeline', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'source' => 'web', 'pub_date' => '2006-03-01 12:00:00'));
     //Add replies to specific post
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 144, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@quoter Indeed, Jon Postel.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'is_reply_by_friend' => 1, 'in_reply_to_post_id' => 134, 'network' => 'twitter', 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308, 77.22496', 'is_geo_encoded' => 1));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 145, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@quoter Fo sho.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'is_reply_by_friend' => 1, 'in_reply_to_post_id' => 134, 'network' => 'twitter', 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308, 77.22496', 'is_geo_encoded' => 1));
     // add another post to user 22 to have a reply to
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 146, 'author_user_id' => 22, 'author_username' => 'quoter', 'author_fullname' => 'Quoter of Quotables', 'network' => 'twitter', 'post_text' => 'I love cake.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 1, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308,77.22496', 'is_geo_encoded' => 1, 'is_protected' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 147, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@quoter YEAH CAKE.', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_retweet_of_post_id' => null, 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'is_reply_by_friend' => 1, 'in_reply_to_post_id' => 146, 'network' => 'twitter', 'location' => 'New Delhi, Delhi, India', 'geo' => '28.635308, 77.22496', 'is_geo_encoded' => 1));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 150, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@ev How soon? :p', 'source' => 'web', 'pub_date' => '2006-03-01 00:00:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_post_id' => null, 'in_reply_to_user_id' => 13, 'is_protected' => 0));
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 151, 'author_user_id' => 20, 'author_username' => 'user1', 'author_fullname' => 'User 1', 'network' => 'twitter', 'post_text' => '@ev Tomorrow? :p', 'source' => 'web', 'pub_date' => '2006-03-01 00:02:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_post_id' => null, 'in_reply_to_user_id' => 13, 'is_protected' => 0));
     //protected post
     $builders[] = FixtureBuilder::build('posts', array('post_id' => 152, 'author_user_id' => 21, 'author_username' => 'user2', 'author_fullname' => 'User 2', 'network' => 'twitter', 'post_text' => 'Protect me', 'source' => 'web', 'pub_date' => '2006-03-01 00:02:00', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'old_retweet_count_cache' => 0, 'in_rt_of_user_id' => null, 'in_reply_to_post_id' => null, 'in_reply_to_user_id' => null, 'is_protected' => 1));
     // insights
     $time_now = date("Y-m-d H:i:s");
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-05-01', 'slug' => 'avg_replies_per_week', 'instance_id' => '1', 'text' => 'Retweet spike! Your post got retweeted 110 times', 'emphasis' => Insight::EMPHASIS_HIGH, 'time_generated' => $time_now, 'related_data' => $this->getRelatedDataListOfPosts('twitter', 3, 3)));
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-05-02', 'slug' => 'avg_replies_per_week', 'instance_id' => '1', 'text' => 'Retweet spike! Your post got retweeted 110 times', 'emphasis' => Insight::EMPHASIS_HIGH, 'time_generated' => $time_now, 'related_data' => $this->getRelatedDataListOfPosts('twitter', 3, 3)));
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-05-03', 'slug' => 'another_slug', 'instance_id' => '1', 'text' => 'Retweet spike! Your post got retweeted 110 times', 'emphasis' => Insight::EMPHASIS_HIGH, 'time_generated' => $time_now, 'related_data' => $this->getRelatedDataListOfPosts('twitter', 3, 3)));
     $builders[] = FixtureBuilder::build('insights', array('date' => '2012-05-04', 'slug' => 'another_slug', 'instance_id' => '1', 'text' => 'Retweet spike! Your post got retweeted 110 times', 'emphasis' => Insight::EMPHASIS_HIGH, 'time_generated' => $time_now, 'related_data' => $this->getRelatedDataListOfPosts('twitter', 3, 3)));
     return $builders;
 }