summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ste/STECore.php2
-rw-r--r--tests/functional/test_user_tag_returns_nothing/Test.php22
-rw-r--r--tests/functional/test_user_tag_returns_nothing/test.tpl1
-rw-r--r--tests/functional/test_user_tag_returns_nothing/want0
4 files changed, 24 insertions, 1 deletions
diff --git a/src/ste/STECore.php b/src/ste/STECore.php
index a53e652..595228b 100644
--- a/src/ste/STECore.php
+++ b/src/ste/STECore.php
@@ -123,7 +123,7 @@ class STECore
throw new RuntimeError("Can not call tag \"$name\": Does not exist.");
}
}
- return call_user_func($this->tags[$name], $this, $params, $sub);
+ return (string)call_user_func($this->tags[$name], $this, $params, $sub);
} catch (RuntimeError $e) {
if (!$this->mute_runtime_errors) {
return "RuntimeError occurred on tag '$name': " . $e->getMessage();
diff --git a/tests/functional/test_user_tag_returns_nothing/Test.php b/tests/functional/test_user_tag_returns_nothing/Test.php
new file mode 100644
index 0000000..cd85908
--- /dev/null
+++ b/tests/functional/test_user_tag_returns_nothing/Test.php
@@ -0,0 +1,22 @@
+<?php
+
+
+namespace tests\functional\test_user_tag_returns_nothing;
+
+use tests\functional\BaseTest;
+use r7r\ste\STECore;
+
+class Test extends BaseTest
+{
+ protected function setUpSte(STECore $ste): void
+ {
+ $ste->register_tag('foobar', function ($ste, $params, $sub) {
+ // nop
+ });
+ }
+
+ protected function getDirectory(): string
+ {
+ return __DIR__;
+ }
+}
diff --git a/tests/functional/test_user_tag_returns_nothing/test.tpl b/tests/functional/test_user_tag_returns_nothing/test.tpl
new file mode 100644
index 0000000..94799a8
--- /dev/null
+++ b/tests/functional/test_user_tag_returns_nothing/test.tpl
@@ -0,0 +1 @@
+<ste:foobar /> \ No newline at end of file
diff --git a/tests/functional/test_user_tag_returns_nothing/want b/tests/functional/test_user_tag_returns_nothing/want
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/functional/test_user_tag_returns_nothing/want