diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-10-23 00:01:49 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-10-23 00:01:49 +0200 |
commit | fc8f7eec23e8e95fc9a4a483bb69a1ee6866069d (patch) | |
tree | d7b9510e21e1c188894d821682327f5bfb9e225e /tests/test.php | |
parent | 04ee002e30b5451d505ee5abd9c6b97c40da2df0 (diff) | |
download | ste-fc8f7eec23e8e95fc9a4a483bb69a1ee6866069d.tar.gz ste-fc8f7eec23e8e95fc9a4a483bb69a1ee6866069d.tar.bz2 ste-fc8f7eec23e8e95fc9a4a483bb69a1ee6866069d.zip |
Added some tests
Diffstat (limited to 'tests/test.php')
-rw-r--r-- | tests/test.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test.php b/tests/test.php new file mode 100644 index 0000000..41713dc --- /dev/null +++ b/tests/test.php @@ -0,0 +1,23 @@ +<?php + +require(dirname(__FILE__) . "/../stupid_template_engine.php"); +require("code.php"); + +class TestStorage implements \ste\StorageAccess { + public function load($tpl, &$mode) { + $mode = \ste\MODE_SOURCE; + return file_get_contents($tpl); + } + + public function save($tpl, $data, $mode) { + if($mode != \ste\MODE_TRANSCOMPILED) { + return; + } + + file_put_contents("$tpl.transc.php", $data); + } +} + +$ste = new \ste\STECore(new TestStorage()); +test_func($ste); +echo $ste->exectemplate("test.tpl"); |