summaryrefslogtreecommitdiff
path: root/tests/test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.php')
-rw-r--r--tests/test.php23
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");