* * ThinkUp/webapp/plugins/embedthread/thread_js.php * * Copyright (c) 2009-2013 Gina Trapani * * LICENSE: * * This file is part of ThinkUp (http://thinkup.com). * * ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public * License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any * later version. * * ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with ThinkUp. If not, see * <http://www.gnu.org/licenses/>. * * @author Gina Trapani <ginatrapani[at]gmail[dot]com> * @license http://www.gnu.org/licenses/gpl.html * @copyright 2009-2013 Gina Trapani */ chdir(".."); chdir(".."); chdir(".."); require_once 'init.php'; $controller = new ThreadJSController(); echo $controller->go();
public function testPublicPostWithMixedAccessReplies() { $b = $this->activateEmbedThread(); $post_builder = FixtureBuilder::build('posts', array('post_id' => '1001', 'author_user_id' => '10', 'author_username' => 'ev', 'post_text' => 'This is a test post', 'retweet_count_cache' => '5', 'network' => 'twitter', 'is_protected' => 0)); $user_builder = FixtureBuilder::build('users', array('user_id' => '10', 'username' => 'ev', 'is_protected' => '0', 'network' => 'twitter')); $public_reply_author_builder1 = FixtureBuilder::build('users', array('user_id' => '11', 'username' => 'jack', 'is_protected' => '0', 'network' => 'twitter')); $reply_builder1 = FixtureBuilder::build('posts', array('post_id' => '1002', 'author_user_id' => '11', 'author_username' => 'jack', 'post_text' => 'This is a public reply to 1001', 'network' => 'twitter', 'in_reply_to_post_id' => 1001, 'is_protected' => '0')); $public_reply_author_builder2 = FixtureBuilder::build('users', array('user_id' => '12', 'username' => 'jill', 'is_protected' => '0', 'network' => 'twitter')); $reply_builder2 = FixtureBuilder::build('posts', array('post_id' => '1003', 'author_user_id' => '12', 'author_username' => 'jill', 'post_text' => 'This is another public reply to 1001', 'network' => 'twitter', 'in_reply_to_post_id' => 1001, 'is_protected' => '0')); $private_reply_author_builder1 = FixtureBuilder::build('users', array('user_id' => '13', 'username' => 'mary', 'is_protected' => '1', 'network' => 'twitter')); $reply_builder3 = FixtureBuilder::build('posts', array('post_id' => '1004', 'author_user_id' => '13', 'author_username' => 'mary', 'post_text' => 'This is a private reply to 1001', 'network' => 'twitter', 'in_reply_to_post_id' => 1001, 'is_protected' => '1')); $_GET['p'] = 1001; $_GET['n'] = 'twitter'; $plugin_dao = new PluginMySQLDAO(); $plugin_id = $plugin_dao->getPluginId('embedthread'); $this->debug($plugin_dao->isPluginActive($plugin_id) ? "EmbedThread is active" : "Not active"); $controller = new ThreadJSController(true); $results = $controller->go(); $v_mgr = $controller->getViewManager(); $config = Config::getInstance(); $this->assertPattern('/This is a test post/', $results); $this->assertPattern('/This is a public reply to 1001/', $results); $this->assertPattern('/This is another public reply to 1001/', $results); $this->assertNoPattern('/This is a private reply to 1001/', $results); $this->debug($results); }