public function setUp() { parent::setUp(); $this->builders = self::buildData(); //set up required Twitter plugin options $this->builders[] = FixtureBuilder::build('options', array('namespace' => 'plugin_options-1', 'option_name' => 'oauth_consumer_secret', 'option_value' => 'testconsumersecret')); $this->builders[] = FixtureBuilder::build('options', array('namespace' => 'plugin_options-1', 'option_name' => 'oauth_consumer_key', 'option_value' => 'testconsumerkey')); }
public function setUp() { parent::setUp(); $this->builders = self::buildData(); //set up some private data //private image post $this->builders[] = FixtureBuilder::build('posts', array('post_id' => 150, 'author_user_id' => 18, 'author_username' => 'shutterbug', 'author_fullname' => 'Shutter Bug', 'author_avatar' => 'avatar.jpg', 'source' => 'web', 'pub_date' => '-1d', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'post_text' => 'This is private image post 1', 'network' => 'twitter', 'is_protected' => 1)); $this->builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/1private', 'expanded_url' => 'http://example.com/1private.jpg', 'title' => '', 'clicks' => 0, 'post_id' => 150, 'image_src' => 'image.png')); //private link post $this->builders[] = FixtureBuilder::build('posts', array('post_id' => 151, 'author_user_id' => 18, 'author_username' => 'shutterbug', 'author_fullname' => 'Shutter Bug', 'author_avatar' => 'avatar.jpg', 'source' => 'web', 'pub_date' => '-1d', 'reply_count_cache' => 0, 'retweet_count_cache' => 0, 'post_text' => 'This is private link post 1', 'network' => 'twitter', 'is_protected' => 1)); $this->builders[] = FixtureBuilder::build('links', array('url' => 'http://example.com/1private', 'expanded_url' => 'http://example.com/private1', 'title' => '', 'clicks' => 0, 'post_id' => 151, 'image_src' => '')); }
public function setUp() { parent::setUp(); //Add owner $session = new Session(); $cryptpass = $session->pwdcrypt("secretpassword"); $q = "INSERT INTO tu_owners (id, email, pwd, is_activated) VALUES (1, '*****@*****.**', '" . $cryptpass . "', 1)"; $this->db->exec($q); //Add instance $q = "INSERT INTO tu_instances (id, network_user_id, network_username, is_public) VALUES (1, 1234,\n 'thinkupapp', 1)"; $this->db->exec($q); //Add instance_owner $q = "INSERT INTO tu_owner_instances (owner_id, instance_id) VALUES (1, 1)"; $this->db->exec($q); }
public function setUp() { parent::setUp(); $this->builders = self::buildData(); }
public function setUp() { parent::setUp(); }
public function setUp() { parent::setUp(); //Add owner $session = new Session(); $cryptpass = $session->pwdcrypt("secretpassword"); $q = "INSERT INTO tu_owners (id, email, pwd, is_activated, is_admin) VALUES (1, '*****@*****.**', '" . $cryptpass . "', 1, 1)"; $this->db->exec($q); //Add instance $q = "INSERT INTO tu_instances (id, network_user_id, network_username, is_public) VALUES (1, 1234,\n 'thinkupapp', 1)"; $this->db->exec($q); //Add instance_owner $q = "INSERT INTO tu_owner_instances (owner_id, instance_id) VALUES (1, 1)"; $this->db->exec($q); //Insert test data into test table $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar) VALUES (12, 'jack', 'Jack Dorsey',\n 'avatar.jpg');"; $this->db->exec($q); $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, last_updated, network) VALUES (13, 'ev',\n 'Ev Williams', 'avatar.jpg', '1/1/2005', 'twitter');"; $this->db->exec($q); $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, is_protected) VALUES (16, 'private',\n 'Private Poster', 'avatar.jpg', 1);"; $this->db->exec($q); $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, is_protected, follower_count) VALUES (17,\n 'thinkupapp', 'ThinkUpers', 'avatar.jpg', 0, 10);"; $this->db->exec($q); $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, is_protected, follower_count) VALUES (18,\n 'shutterbug', 'Shutter Bug', 'avatar.jpg', 0, 10);"; $this->db->exec($q); $q = "INSERT INTO tu_users (user_id, user_name, full_name, avatar, is_protected, follower_count) VALUES (19,\n 'linkbaiter', 'Link Baiter', 'avatar.jpg', 0, 10);"; $this->db->exec($q); $q = "INSERT INTO tu_user_errors (user_id, error_code, error_text, error_issued_to_user_id) VALUES (15, 404,\n 'User not found', 13);"; $this->db->exec($q); $q = "INSERT INTO tu_follows (user_id, follower_id, last_seen) VALUES (13, 12, '1/1/2006');"; $this->db->exec($q); $q = "INSERT INTO tu_follows (user_id, follower_id, last_seen) VALUES (13, 14, '1/1/2006');"; $this->db->exec($q); $q = "INSERT INTO tu_follows (user_id, follower_id, last_seen) VALUES (13, 15, '1/1/2006');"; $this->db->exec($q); $q = "INSERT INTO tu_follows (user_id, follower_id, last_seen) VALUES (13, 16, '1/1/2006');"; $this->db->exec($q); $q = "INSERT INTO tu_follows (user_id, follower_id, last_seen) VALUES (16, 12, '1/1/2006');"; $this->db->exec($q); $q = "INSERT INTO tu_instances (network_user_id, network_username, is_public) VALUES (13, 'ev', 1);"; $this->db->exec($q); $q = "INSERT INTO tu_instances (network_user_id, network_username, is_public) VALUES (18, 'shutterbug', 1);"; $this->db->exec($q); $q = "INSERT INTO tu_instances (network_user_id, network_username, is_public) VALUES (19, 'linkbaiter', 1);"; $this->db->exec($q); $counter = 0; while ($counter < 40) { $reply_or_forward_count = $counter + 200; $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', \n {$reply_or_forward_count}, {$reply_or_forward_count});"; $this->db->exec($q); $counter++; } $counter = 0; while ($counter < 40) { $post_id = $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 ({$post_id}, 18, 'shutterbug', \n 'Shutter Bug', 'avatar.jpg', 'This is image post {$counter}', 'web', \n '2006-01-02 00:{$pseudo_minute}:00', 0, 0);"; $this->db->exec($q); $q = "INSERT INTO tu_links (url, expanded_url, title, clicks, post_id, is_image)\n VALUES ('http://example.com/" . $counter . "', 'http://example.com/" . $counter . ".jpg', '', 0, {$post_id}, 1);"; $this->db->exec($q); $counter++; } $counter = 0; while ($counter < 40) { $post_id = $counter + 80; $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 ({$post_id}, 19, 'linkbaiter', \n 'Link Baiter', 'avatar.jpg', 'This is link post {$counter}', 'web', \n '2006-03-01 00:{$pseudo_minute}:00', 0, 0);"; $this->db->exec($q); $q = "INSERT INTO tu_links (url, expanded_url, title, clicks, post_id, is_image) VALUES\n ('http://example.com/" . $counter . "', 'http://example.com/" . $counter . ".html', 'Link {$counter}', 0, \n {$post_id}, 0);"; $this->db->exec($q); $counter++; } $counter = 0; while ($counter < 10) { $post_id = $counter + 120; $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 ({$post_id}, 1234, \n 'thinkupapp', 'thinkupapp', 'avatar.jpg', 'This is test post {$counter}', 'web', \n '2006-03-01 00:{$pseudo_minute}:00', 0, 0);"; $this->db->exec($q); $counter++; } }