@@ -51,6 +51,16 @@ public function testPHP_REMOVEasp()
5151 $ this ->assertEquals ("a echo 'hello world';e " , $ content , 'remove <% %> ' );
5252
5353
54+ }
55+ /**
56+ * test <script language='php'>...</script> tag
57+ * PHP_REMOVE
58+ */
59+ public function testPHP_REMOVEscript ()
60+ {
61+ $ this ->smarty ->setPhpHandling (Smarty::PHP_REMOVE );
62+ $ content = $ this ->smarty ->fetch ("string:a<script language='php'> echo 'hello world';</script>e " );
63+ $ this ->assertEquals ("a echo 'hello world';e " , $ content , "remove <script language='php'> " );
5464 }
5565 /**
5666 * test <?php...\> tag
@@ -75,6 +85,16 @@ public function testPHP_PASSTHRUasp()
7585 $ content = $ this ->smarty ->fetch ("string:pa<% echo 'hello world';%>pe " );
7686 $ this ->assertEquals ("pa<% echo 'hello world';%>pe " , $ content , 'passthru <% %> ' );
7787 }
88+ /**
89+ * test <script language='php'>...</script> tag
90+ * PHP_PASSTHRU
91+ */
92+ public function testPHP_PASSTHRUscript ()
93+ {
94+ $ this ->smarty ->setPhpHandling (Smarty::PHP_PASSTHRU );
95+ $ content = $ this ->smarty ->fetch ("string:pa<script language='php'> echo 'hello world';</script>pe " );
96+ $ this ->assertEquals ("pa<script language=\'php\'> echo 'hello world';</script>pe " , $ content , "passthru <script language='php'> " );
97+ }
7898 /**
7999 * test <?php...\> tag
80100 * PHP_QUOTE
@@ -98,6 +118,16 @@ public function testPHP_QUOTEasp()
98118 $ content = $ this ->smarty ->fetch ("string:qa<% echo 'hello world';%>qe " );
99119 $ this ->assertEquals ("qa<% echo 'hello world';%>qe " , $ content , 'qoute <% %> ' );
100120 }
121+ /**
122+ * test <script language='php'>...</script> tag
123+ * PHP_QUOTE
124+ */
125+ public function testPHP_QUOTEscript ()
126+ {
127+ $ this ->smarty ->setPhpHandling (Smarty::PHP_QUOTE );
128+ $ content = $ this ->smarty ->fetch ("string:qa<script language='php'> echo 'hello world';</script>qe " );
129+ $ this ->assertEquals ("qa<script language='php'> echo 'hello world';</script>qe " , $ content , "quote <script language='php'> " );
130+ }
101131 /**
102132 * test <?php...\> tag
103133 * PHP_ALLOW
@@ -120,6 +150,16 @@ public function testPHP_ALLOWasp()
120150 $ content = $ this ->smartyBC ->fetch ("string:aa <% echo 'hello world';%> ae " );
121151 $ this ->assertEquals ('aa hello world ae ' , $ content , 'allow <% %> ' );
122152 }
153+ /**
154+ * test <script language='php'>...</script> tag
155+ * PHP_ALLOW
156+ */
157+ public function testPHP_ALLOWscript ()
158+ {
159+ $ this ->smartyBC ->setPhpHandling (Smarty::PHP_ALLOW );
160+ $ content = $ this ->smartyBC ->fetch ("string:aa <script language='php'> echo 'hello world';</script> ae " );
161+ $ this ->assertEquals ('aa hello world ae ' , $ content , "allow <script language='php'> " );
162+ }
123163 /**
124164 * test <?php...\> tag
125165 * PHP_ALLOW
0 commit comments