summaryrefslogtreecommitdiff
path: root/tests/functional/test_scoping
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/test_scoping')
-rw-r--r--tests/functional/test_scoping/Test.php18
-rw-r--r--tests/functional/test_scoping/test.tpl18
-rw-r--r--tests/functional/test_scoping/want9
3 files changed, 45 insertions, 0 deletions
diff --git a/tests/functional/test_scoping/Test.php b/tests/functional/test_scoping/Test.php
new file mode 100644
index 0000000..b15f911
--- /dev/null
+++ b/tests/functional/test_scoping/Test.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace tests\functional\test_scoping;
+
+use kch42\ste\STECore;
+use tests\functional\BaseTest;
+
+class Test extends BaseTest
+{
+ protected function getDirectory(): string
+ {
+ return __DIR__;
+ }
+
+ protected function setUpSte(STECore $ste): void
+ {
+ }
+}
diff --git a/tests/functional/test_scoping/test.tpl b/tests/functional/test_scoping/test.tpl
new file mode 100644
index 0000000..e8a5cf2
--- /dev/null
+++ b/tests/functional/test_scoping/test.tpl
@@ -0,0 +1,18 @@
+<ste:set var="a">A</ste:set>
+<ste:set var="b">B</ste:set>
+<ste:mktag name="foo">
+ in foo: \$a = $a
+ in foo: \$b = $b
+ in foo: \$c = $c
+ <ste:set var="a">X</ste:set>
+ <ste:setlocal var="b">Y</ste:setlocal>
+ <ste:set var="c">Z</ste:set>
+ in foo (after set): \$a = $a
+ in foo (after set): \$b = $b
+ in foo (after set): \$c = $c
+</ste:mktag>
+
+<ste:foo />
+\$a = $a
+\$b = $b
+\$c = $c \ No newline at end of file
diff --git a/tests/functional/test_scoping/want b/tests/functional/test_scoping/want
new file mode 100644
index 0000000..6e7a154
--- /dev/null
+++ b/tests/functional/test_scoping/want
@@ -0,0 +1,9 @@
+in foo: $a = A
+in foo: $b = B
+in foo: $c =
+in foo (after set): $a = X
+in foo (after set): $b = Y
+in foo (after set): $c = Z
+$a = X
+$b = B
+$c =