summaryrefslogtreecommitdiff
path: root/tests/test_tagname
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tagname')
-rw-r--r--tests/test_tagname/.gitignore3
-rw-r--r--tests/test_tagname/code.php20
-rw-r--r--tests/test_tagname/test.tpl4
-rw-r--r--tests/test_tagname/want4
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_tagname/.gitignore b/tests/test_tagname/.gitignore
new file mode 100644
index 0000000..de2a41b
--- /dev/null
+++ b/tests/test_tagname/.gitignore
@@ -0,0 +1,3 @@
+have
+*.ast
+*.transc.php
diff --git a/tests/test_tagname/code.php b/tests/test_tagname/code.php
new file mode 100644
index 0000000..6001358
--- /dev/null
+++ b/tests/test_tagname/code.php
@@ -0,0 +1,20 @@
+<?php
+
+use kch42\ste\STECore;
+
+function test_func(STECore $ste) {
+ $names = array(
+ "foo",
+ "ab_cd",
+ "foo123baz",
+ "x0123",
+ );
+
+ foreach ($names as $name) {
+ $ste->register_tag(
+ $name,
+ function ($ste, $params, $sub) use ($name) { return $name; }
+ );
+ }
+
+}
diff --git a/tests/test_tagname/test.tpl b/tests/test_tagname/test.tpl
new file mode 100644
index 0000000..30ca889
--- /dev/null
+++ b/tests/test_tagname/test.tpl
@@ -0,0 +1,4 @@
+<ste:foo />
+<ste:ab_cd />
+<ste:foo123baz />
+<ste:x0123 /> \ No newline at end of file
diff --git a/tests/test_tagname/want b/tests/test_tagname/want
new file mode 100644
index 0000000..3233294
--- /dev/null
+++ b/tests/test_tagname/want
@@ -0,0 +1,4 @@
+foo
+ab_cd
+foo123baz
+x0123