예제 #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() {
		CoOrgSmarty::$vars = array();
		Session::$site = 'http://www.test.info/';
		Session::$referrer = 'http://www.test.info/some/part/of/the/site';
		$config = new Config('config/tests.config.php');
		$config->set('aside/main', array('home/alpha'));
		CoOrg::init($config, 'coorg/tests/mocks/app', 'coorg/tests/mocks/plugins');
		I18n::setLanguage('');
	}
예제 #3
0
function smarty_modifier_static($param, $plugin = null)
{
	$static = CoOrg::staticFile($param, $plugin);
	if (is_array($static))
	{
		CoOrgSmarty::$_static_array = $static;
		return $static[0];
	}
	else
	{
		return $static;
	}
}
예제 #4
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__';
	}
예제 #5
0
	private function prepareASmarty()
	{
		$smarty = new CoOrgSmarty;
		$smarty->addTemplateDir($this->_appPath);
		$smarty->addPluginsDir('lib/smarty/plugins/coorg');
		
		//TODO: Use anonymous functions/closures (only available in PHP 5.3)
		$smarty->_coorg_createURL = array($this, 'createURL');
		return $smarty;
	}
예제 #6
0
	public function fakeRender($tpl)
	{
		self::$renderedTemplate = $tpl;
	}
예제 #7
0
	public function stylesheet($style)
	{
		if (self::$_static_array)
		{
			foreach (self::$_static_array as $s)
			{
				$this->_stylesheets[] = $s;
			}
			self::$_static_array = null;
		}
		else
		{
			$this->_stylesheets[] = $style;
		}
	}