Ejemplo n.º 1
0
 public function testGetAdditionalItems() {
     $builders = $this->buildData();
     // Test that an item is added in the RSS feed when the crawler log is not writable
     $controller = new RSSController(true);
     $config = Config::getInstance();
     $config->setValue('log_location', '/something/that/doesnt/exits');
     $_GET['un'] = '*****@*****.**';
     $_GET['as'] = Session::getAPISecretFromPassword('XXX');
     $_SERVER['HTTP_HOST'] = 'http://localhost';
     $results = $controller->go();
     $this->assertPattern("/Error: crawler log is not writable/", $results);
 }
Ejemplo n.º 2
0
/**
 *
 * ThinkUp/webapp/crawler/rss.php
 *
 * Copyright (c) 2009-2015 Guillaume Boudreau
 *
 * 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 Guillaume Boudreau <gboudreau[at]pommepause[dot]com>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2009-2015 Guillaume Boudreau
 */
chdir("..");
require_once 'init.php';
$controller = new RSSController();
echo $controller->go();
Ejemplo n.º 3
0
 public function testInsightsInFeed()
 {
     $builders = $this->buildData();
     $builders_insights = $this->buildDataInsights();
     $controller = new RSSController(true);
     $_GET['un'] = '*****@*****.**';
     $_GET['as'] = 'c9089f3c9adaf0186f6ffb1ee8d6501c';
     $results = $controller->go();
     $this->debug($results);
     $this->assertNoPattern("/No insights exist/", $results);
     $this->assertPattern("/Hello/", $results);
     $this->assertPattern("/This is a test of a hello world insight/", $results);
 }
Ejemplo n.º 4
0
 public function testPerOwnerRefreshRate()
 {
     // $THINKUP_CFG['rss_crawler_refresh_rate'] should apply per owner
     $builders = $this->buildData();
     $controller = new RSSController(true);
     $_GET['un'] = '*****@*****.**';
     $_GET['as'] = 'c9089f3c9adaf0186f6ffb1ee8d6501c';
     $results = $controller->go();
     $this->assertPattern("/ThinkUp crawl started/", $results);
     $instanceDAO = new InstanceMySQLDAO();
     $instanceDAO->updateLastRun(1);
     // the crawler should start for the second owner despite a recent last
     // run time for instance 1 owned by owner 1
     $controller = new RSSController(true);
     $_GET['un'] = '*****@*****.**';
     $_GET['as'] = 'a34e120dc6807e0dffc0d2b973b9d55b';
     $results = $controller->go();
     $this->assertPattern("/ThinkUp crawl started/", $results);
 }