summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2015-04-14 22:13:35 +0200
committerKevin Chabowski <kevin@kch42.de>2015-04-14 22:13:35 +0200
commit17f662cc6ff4f50c30270a23f6679af1b251e82c (patch)
tree6121b4cc2596ffe37c2fd79a446d30843e40ccd3 /tests
parent51438e2ce27d4caee69d310d27a0f2b865cdcdb8 (diff)
downloadste-17f662cc6ff4f50c30270a23f6679af1b251e82c.tar.gz
ste-17f662cc6ff4f50c30270a23f6679af1b251e82c.tar.bz2
ste-17f662cc6ff4f50c30270a23f6679af1b251e82c.zip
$escape_method is now private
Diffstat (limited to 'tests')
-rw-r--r--tests/test.php9
-rw-r--r--tests/test_autoescape/code.php7
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/test.php b/tests/test.php
index ed45d3e..f051d94 100644
--- a/tests/test.php
+++ b/tests/test.php
@@ -1,10 +1,15 @@
<?php
require(dirname(__FILE__) . "/../steloader.php");
-require("code.php");
use \kch42\ste;
+$ste_initializer = function($sa) {
+ return new ste\STECore($sa);
+};
+
+require("code.php");
+
class TestStorage implements ste\StorageAccess {
public function load($tpl, &$mode) {
$mode = ste\StorageAccess::MODE_SOURCE;
@@ -20,7 +25,7 @@ class TestStorage implements ste\StorageAccess {
}
}
-$ste = new ste\STECore(new TestStorage());
+$ste = $ste_initializer(new TestStorage());
$ste->mute_runtime_errors = false;
test_func($ste);
echo $ste->exectemplate("test.tpl");
diff --git a/tests/test_autoescape/code.php b/tests/test_autoescape/code.php
index 4f7c998..9f73700 100644
--- a/tests/test_autoescape/code.php
+++ b/tests/test_autoescape/code.php
@@ -2,13 +2,14 @@
use kch42\ste\STECore;
+$ste_initializer = function($sa) {
+ return new STECore($sa, STECore::ESCAPE_HTML);
+};
+
function test_func($ste) {
$ste->vars['test'] = 'foo"&<bar>';
$ste->register_tag('echoarg', function ($ste, $params, $sub) {
return $params['echo'];
});
-
- // Autoescaping enabled by default
- $ste->escape_method = STECore::ESCAPE_HTML;
}