summaryrefslogtreecommitdiff
path: root/tests/test.php
blob: fcfac0e2ef4ea396f30376624a9c68f247ed1bbb (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
25
26
<?php

require(dirname(__FILE__) . "/../steloader.php");
require("code.php");

use \kch42\ste;

class TestStorage implements ste\StorageAccess {
    public function load($tpl, &$mode) {
        $mode = ste\StorageAccess::MODE_SOURCE;
        return file_get_contents($tpl);
    }

    public function save($tpl, $data, $mode) {
        if($mode != ste\StorageAccess::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");