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(); }
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__'; }
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); } }
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); }
private function alternativeConfig($config) { CoOrg::init($config, 'coorg/tests/mocks/app', 'coorg/tests/mocks/plugins'); }