| 1 |
dc33f4
|
Seldaek |
<?php |
|
| 2 |
↓
|
Seldaek |
|
|
| 3 |
dd288f
|
Seldaek |
require_once DWOO_DIRECTORY . 'Dwoo/Compiler.php'; |
|
| 4 |
↓
|
Seldaek |
require DWOO_DIRECTORY . 'Dwoo/Smarty/Adapter.php'; |
|
| 5 |
dc33f4
|
Seldaek |
|
|
| 6 |
↓
|
Seldaek |
class SmartyTests extends PHPUnit_Framework_TestCase |
|
| 7 |
↓
|
Seldaek |
{ |
|
| 8 |
↓
|
Seldaek |
protected $dwoo; |
|
| 9 |
↓
|
Seldaek |
|
|
| 10 |
↓
|
Seldaek |
public function __construct() |
|
| 11 |
↓
|
Seldaek |
{ |
|
| 12 |
↓
|
Seldaek |
// extend this class and override this in your constructor to test a modded compiler |
|
| 13 |
9cf6ad
|
Seldaek |
$this->dwoo = new Dwoo_Smarty_Adapter(); |
|
| 14 |
5b6806
|
Seldaek |
$this->dwoo->template_dir = TEST_DIRECTORY.'/resources/'; |
|
| 15 |
↓
|
Seldaek |
$this->dwoo->compile_dir = TEST_DIRECTORY.'/temp/compiled/'; |
|
| 16 |
↓
|
Seldaek |
$this->dwoo->cache_dir = TEST_DIRECTORY.'/temp/cache/'; |
|
| 17 |
↓
|
Seldaek |
$this->dwoo->config_dir = TEST_DIRECTORY.'/resources/configs/'; |
|
| 18 |
9cf6ad
|
Seldaek |
$this->compiler = new Dwoo_Compiler(); |
|
| 19 |
dc33f4
|
Seldaek |
$this->compiler->addPreProcessor('smarty_compat', true); |
|
| 20 |
↓
|
Seldaek |
} |
|
| 21 |
↓
|
Seldaek |
|
|
| 22 |
↓
|
Seldaek |
public function testSmartyCompat() |
|
| 23 |
↓
|
Seldaek |
{ |
|
| 24 |
6dd36b
|
seldaek |
$this->dwoo->assign('arr', array('ab','cd','ef')); |
|
| 25 |
9315dc
|
seldaek |
$this->assertEquals('{'.Dwoo_Core::VERSION.'} ab cd ef', $this->dwoo->fetch('smartytest.html')); |
|
| 26 |
dc33f4
|
Seldaek |
} |
|
| 27 |
↓
|
Seldaek |
} |
|