Commit 5b6806a0 by Seldaek

* Fixed tests broken because of moved files

git-svn-id: svn://dwoo.org/dwoo/trunk@36 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 418fa1a9
......@@ -118,7 +118,7 @@ class CoreTests extends PHPUnit_Framework_TestCase
public function testDwoo_GetFilename()
{
$this->assertEquals('44BAR', $this->dwoo->get(dirname(__FILE__).DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'test.html', array('foo'=>44, 'bar'=>'BAR')));
$this->assertEquals('44BAR', $this->dwoo->get(TEST_DIRECTORY.'/resources/test.html', array('foo'=>44, 'bar'=>'BAR')));
}
public function testAssignVarInScope()
......@@ -189,21 +189,21 @@ class CoreTests extends PHPUnit_Framework_TestCase
public function testAddAndRemoveResource()
{
$this->dwoo->addResource('news', 'Dwoo_Template_File', array('Dwoo_Compiler', 'compilerFactory'));
$tpl = new Dwoo_Template_String('{include file="news:'.DWOO_DIRECTORY.'tests/resources/test.html" foo=3 bar=4}');
$tpl = new Dwoo_Template_String('{include file="news:'.TEST_DIRECTORY.'/resources/test.html" foo=3 bar=4}');
$tpl->forceCompilation();
$this->assertEquals("34", $this->dwoo->get($tpl, array()));
$this->dwoo->removeResource('news');
$this->dwoo->addResource('file', 'Dwoo_Template_String', 'Fake');
$this->dwoo->removeResource('file');
$tpl = new Dwoo_Template_String('{include file="file:'.DWOO_DIRECTORY.'tests/resources/test.html" foo=3 bar=4}');
$tpl = new Dwoo_Template_String('{include file="file:'.TEST_DIRECTORY.'/resources/test.html" foo=3 bar=4}');
$tpl->forceCompilation();
$this->assertEquals("34", $this->dwoo->get($tpl, array()));
}
public function testTemplateFile()
{
$tpl = new Dwoo_Template_File(DWOO_DIRECTORY.'tests/resources/test.html');
$tpl = new Dwoo_Template_File(TEST_DIRECTORY.'/resources/test.html');
$tpl->forceCompilation();
$this->assertEquals("12", $this->dwoo->get($tpl, array('foo'=>1, 'bar'=>2)));
......
......@@ -5,7 +5,8 @@ if(!ini_get('date.timezone'))
date_default_timezone_set('CET');
define('DWOO_CACHE_DIRECTORY', dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR.'cache');
define('DWOO_COMPILE_DIRECTORY', dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR.'compiled');
require dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Dwoo.php';
require dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Dwoo.php';
define('TEST_DIRECTORY', dirname(__FILE__));
class DwooTests {
public static function suite() {
......
......@@ -206,7 +206,7 @@ class FuncTests extends PHPUnit_Framework_TestCase
public function testFetch()
{
$tpl = new Dwoo_Template_String('{fetch file="'.DWOO_DIRECTORY.'tests/resources/test.html"}');
$tpl = new Dwoo_Template_String('{fetch file="'.TEST_DIRECTORY.'/resources/test.html"}');
$tpl->forceCompilation();
$this->assertEquals('{$foo}{$bar}', $this->dwoo->get($tpl, array(), $this->compiler));
......@@ -214,12 +214,12 @@ class FuncTests extends PHPUnit_Framework_TestCase
public function testInclude()
{
$tpl = new Dwoo_Template_String('{include file=\'file:'.DWOO_DIRECTORY.'tests/resources/test.html\' foo=$a bar=$b}');
$tpl = new Dwoo_Template_String('{include file=\'file:'.TEST_DIRECTORY.'/resources/test.html\' foo=$a bar=$b}');
$tpl->forceCompilation();
$this->assertEquals("AB", $this->dwoo->get($tpl, array('a'=>'A', 'b'=>'B')));
$tpl = new Dwoo_Template_String('{include file=\'file:'.DWOO_DIRECTORY.'tests/resources/test.html\'}');
$tpl = new Dwoo_Template_String('{include file=\'file:'.TEST_DIRECTORY.'/resources/test.html\'}');
$tpl->forceCompilation();
$this->assertEquals("ab", $this->dwoo->get($tpl, array('foo'=>'a', 'bar'=>'b'), $this->compiler));
......@@ -229,7 +229,7 @@ class FuncTests extends PHPUnit_Framework_TestCase
$this->assertEquals("", $this->dwoo->get($tpl, array('foo'=>'a', 'bar'=>'b'), $this->compiler));
$tpl = new Dwoo_Template_File(DWOO_DIRECTORY.'tests/resources/inctest.html');
$tpl = new Dwoo_Template_File(TEST_DIRECTORY.'/resources/inctest.html');
$tpl->forceCompilation();
$this->assertEquals("34", $this->dwoo->get($tpl, array(), $this->compiler));
......
......@@ -11,10 +11,10 @@ class SmartyTests extends PHPUnit_Framework_TestCase
{
// extend this class and override this in your constructor to test a modded compiler
$this->dwoo = new Dwoo_Smarty_Adapter();
$this->dwoo->template_dir = DWOO_DIRECTORY.'tests/resources/';
$this->dwoo->compile_dir = DWOO_DIRECTORY.'tests/temp/compiled/';
$this->dwoo->cache_dir = DWOO_DIRECTORY.'tests/temp/cache/';
$this->dwoo->config_dir = DWOO_DIRECTORY.'tests/resources/configs/';
$this->dwoo->template_dir = TEST_DIRECTORY.'/resources/';
$this->dwoo->compile_dir = TEST_DIRECTORY.'/temp/compiled/';
$this->dwoo->cache_dir = TEST_DIRECTORY.'/temp/cache/';
$this->dwoo->config_dir = TEST_DIRECTORY.'/resources/configs/';
$this->compiler = new Dwoo_Compiler();
$this->compiler->addPreProcessor('smarty_compat', true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment