aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2011-09-05 11:57:18 +0300
committerVjacheslav Trushkin <arty@phpbb.com>2011-09-05 11:57:18 +0300
commitd8f4f92dae2af2acba1719c9532561ec1143af66 (patch)
tree49e0464fa00c0ee5cf7a36bcd8426f159fc7c876 /tests/template
parent0cb539ed72d961618b69103b9d7717c550dafbd3 (diff)
downloadforums-d8f4f92dae2af2acba1719c9532561ec1143af66.tar
forums-d8f4f92dae2af2acba1719c9532561ec1143af66.tar.gz
forums-d8f4f92dae2af2acba1719c9532561ec1143af66.tar.bz2
forums-d8f4f92dae2af2acba1719c9532561ec1143af66.tar.xz
forums-d8f4f92dae2af2acba1719c9532561ec1143af66.zip
[ticket/10350] Script for testing eval renderer
Script for testing eval renderer (fixed) PHPBB3-10350
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/renderer_eval_test.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/template/renderer_eval_test.php b/tests/template/renderer_eval_test.php
new file mode 100644
index 0000000000..c30516ba97
--- /dev/null
+++ b/tests/template/renderer_eval_test.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+class phpbb_template_renderer_eval_test extends phpbb_test_case
+{
+ public function test_eval()
+ {
+ $compiled_code = '<a href="<?php echo \'Test\'; ?>">';
+ $valid_code = '<a href="Test">';
+ $context = new phpbb_template_context();
+ $template = new phpbb_template_renderer_eval($compiled_code, NULL);
+ ob_start();
+ try
+ {
+ $template->render($context, array());
+ }
+ catch (Exception $exception)
+ {
+ ob_end_clean();
+ throw $exception;
+ }
+ $output = ob_get_clean();
+ $this->assertEquals($valid_code, $output);
+ }
+}