summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2012-08-08 16:45:23 +0000
committerNathan Gass2012-08-08 16:45:23 +0000
commit63905bb0a9c91e6ff61bcc5896246ec9a8d632bc (patch)
tree1e85e203c7663bd1c5b44bc816bfbb91f30ef756
parent362fc6c961f7dcb658c9393acd293f203f190f53 (diff)
downloaditools-63905bb0a9c91e6ff61bcc5896246ec9a8d632bc.tar.gz
itools-63905bb0a9c91e6ff61bcc5896246ec9a8d632bc.tar.bz2
itools-63905bb0a9c91e6ff61bcc5896246ec9a8d632bc.zip
some more special char tests (normal utf8 chars, \xc2 at end, null bytes)
-rwxr-xr-xtests/it_html.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/it_html.t b/tests/it_html.t
index 2838ae1..2ed151c 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -1,6 +1,8 @@
#!/www/server/bin/php -qC
<?php
+it::getopt(""); #handle possible --debug parameter
+
# Tests for html.class
# Traditional html generation
@@ -56,6 +58,25 @@ is(
);
is(
+ div('arg' => "abc äüö éá© œàè îôÇ xyz", "abc äüö éá© œàè îôÇ xyz"),
+ "<div arg=\"abc äüö éá© œàè îôÇ xyz\">abc äüö éá© œàè îôÇ xyz</div>\n",
+ "leave legal utf8 intact",
+);
+
+unset($GLOBALS['debug_utf8check']);
+is(
+ div('arg' => "value \xc2", "content"),
+ "<div arg=\"value \xc2\">content</div>\n",
+ "handle single \\xc2 at end of attribute value",
+);
+
+is(
+ div("arg\x00end" => "value \x00 end", "content \x00 content end"),
+ "<div arg\x00end=\"value end\">content \x00 content end</div>\n",
+ "handle 0-bytes",
+);
+
+is(
div('arg' => "& \" < > \n '", "& \" < > \n '"),
"<div arg=\"&amp; &quot; &lt; &gt; &#10; '\">& \" < > \n '</div>\n",
"use html entities in attributes but not in normal text",