コード例 #1
0
	public function setUp() {
		Session::$site = 'http://www.test.info/';
		Session::$referrer = 'http://www.test.info/some/part/of/the/site';
		$config = new Config('config/tests.config.php');
		CoOrg::init($config, 'coorg/tests/mocks/app', 'coorg/tests/mocks/plugins');
		CoOrgSmarty::$vars = array();
	}
コード例 #2
0
	public function setUp()
	{
		parent::setUp();
		I18n::setLanguage('');
		Session::destroy();
		if ($s = UserSession::get())
		{
			$s->delete();
		}
		Session::$site = 'http://www.test.info/';
		Session::$referrer = 'http://www.test.info/some/part/of/the/site';
		unlink(COORG_TEST_CONFIG);
		copy(COORG_TEST_CONFIG_CLEAN, COORG_TEST_CONFIG);
		$config = new Config(COORG_TEST_CONFIG);
		$config->set('site/title', 'The Site');
		$config->set('defaultLanguage', '');
		CoOrg::init($config, 'app', 'plugins');
		CoOrgSmarty::clearAll();
		Header::$redirect = '__none__';
	}
コード例 #3
0
ファイル: testsboots.php プロジェクト: nathansamson/CoOrg
copy($configFile, 'config/temp.config.tests.php');
$configFile = 'config/temp.config.tests.php';
define('COORG_TEST_CONFIG_CLEAN', $configFile.'.clean');
define('COORG_TEST_CONFIG', $configFile);

$config = new Config($configFile);
$config->set('mollom/public', 'valid-pub-key');
$config->set('mollom/private', 'valid-priv-key');
$config->set('mollom/serverlist', array('valid-server-list'));
$config->set('enabled_plugins', array('search', 'spam', 'admin', 'menu', 'user', 'comments', 'user-admin', 'blog', 'page', 'puntstudio-users'));
$config->set('site/title', 'The Site');
$config->save();
copy($configFile, 'config/temp.config.tests.php.clean');
DB::open($config->get('dbdsn'), $config->get('dbuser'), $config->get('dbpass'));

CoOrg::init($config, 'coorg/testing/plugins-app', 'plugins'); // Load the models


function prepare($plugins)
{
	foreach (array_reverse($plugins) as $p)
	{
		if (file_exists('plugins/'.$p.'/install.php'))
		{
			include_once 'plugins/'.$p.'/install.php';
			
			$f = str_replace('-', '_', $p);
			call_user_func($f.'_delete_db', true);
		}
	}
	
コード例 #4
0
ファイル: coorg.class.php プロジェクト: nathansamson/CoOrg
	public static function run()
	{
		$config = new Config('config/config.php');
		CoOrg::init($config, 'app', 'plugins');
		DB::open($config->get('dbdsn'), $config->get('dbuser'),
		         $config->get('dbpass'));
		
		if (get_magic_quotes_gpc())
		{
			self::clearMessAfterMagicQuotes();
		}
		
		$params = array();
		$post = false;
		if (array_key_exists('r', $_GET)) {
			$request = $_GET['r'];
			if (count($_GET) > 1) {
				$params = $_GET;
			} else if (count($_POST) > 0) {
				$params = $_POST;
				$post = true;
			}
		} else {
			$request = '';
		}
		self::process($request, $params, $post);
	}
コード例 #5
0
ファイル: coorg.Test.php プロジェクト: nathansamson/CoOrg
	private function alternativeConfig($config)
	{
		CoOrg::init($config, 'coorg/tests/mocks/app', 'coorg/tests/mocks/plugins');
	}