summaryrefslogtreecommitdiff
path: root/tests/test.php
blob: 79fb69d8e9772d5838a528d38e65777bf826f10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

require(dirname(__FILE__) . "/../ste.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());
$ste->mute_runtime_errors = false;
test_func($ste);
echo $ste->exectemplate("test.tpl");