public function testNotOptedOut()
 {
     include THINKUP_ROOT_PATH . 'webapp/install/version.php';
     $this->simulateLogin('*****@*****.**');
     $controller = new CheckVersionController(true);
     $results = $controller->go();
     $this->assertPattern('/var CONTENT_URL = \'http:\\/\\/thinkupapp.com\\/version.php\\?v=' . $THINKUP_VERSION . '/', $results);
     $this->assertNoPattern('/var CONTENT_URL = \'http:\\/\\/thinkupapp.com\\/version.php?v=' . $THINKUP_VERSION . '\\&usage=n/', $results);
 }
 public function testInBetaOptedOut()
 {
     include THINKUP_WEBAPP_PATH . 'install/version.php';
     $bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_subscribed_to_beta', 'option_value' => 'true');
     $bdata = FixtureBuilder::build('options', $bvalues);
     $bvalues1 = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_opted_out_usage_stats', 'option_value' => 'true');
     $bdata2 = FixtureBuilder::build('options', $bvalues);
     $this->simulateLogin('*****@*****.**');
     $controller = new CheckVersionController(true);
     $results = $controller->go();
     $this->assertPattern('/var CONTENT_URL = \'http:\\/\\/thinkup.com\\/version.php\\?channel=beta\\&v=' . $THINKUP_VERSION . '/', $results);
     $this->assertNoPattern('/var CONTENT_URL = \'http:\\/\\/thinkup.com\\/version.php?v=' . $THINKUP_VERSION . '\\&usage=n/', $results);
 }
Exemple #3
0
/**
 *
 * ThinkUp/webapp/install/checkversion.php
 *
 * Copyright (c) 2011-2016 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 Mark Wilkie <mwilkie[at]gmail[dot]com>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2011-2016 Gina Trapani
 */
chdir('..');
require_once 'init.php';
$controller = new CheckVersionController();
echo $controller->go();