summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2010-04-14 17:05:58 +0000
committerChristian Schneider2010-04-14 17:05:58 +0000
commitcf4e235bd13cff414a8e5146c179d3b4155e1d9c (patch)
treecd823e9ed6c8ab5493a9ee344aa147c1c77fe347
parentf4e93bf8d9a80f82454b147dfb8481b102ec717f (diff)
downloaditools-cf4e235bd13cff414a8e5146c179d3b4155e1d9c.tar.gz
itools-cf4e235bd13cff414a8e5146c179d3b4155e1d9c.tar.bz2
itools-cf4e235bd13cff414a8e5146c179d3b4155e1d9c.zip
Added it_xml test for invalid latin1 character, converted all tests to old syntax
-rwxr-xr-xtests/it_html.t2
-rwxr-xr-xtests/it_url.t6
-rwxr-xr-xtests/it_xml.t18
3 files changed, 17 insertions, 9 deletions
diff --git a/tests/it_html.t b/tests/it_html.t
index 883753d..0a3f4eb 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -134,7 +134,7 @@ is(
is(
U("Jet d'eau"),
'Jet+d%27eau',
- 'U() with single quotes in URL',
+ 'U() with single quotes in URL'
);
is(
diff --git a/tests/it_url.t b/tests/it_url.t
index 1117aff..d017610 100755
--- a/tests/it_url.t
+++ b/tests/it_url.t
@@ -67,14 +67,14 @@ $_SERVER['HTTP_HOST'] = "gna.ch";
is(
it_url::absolute("/"),
'http://gna.ch:/',
- 'it_url::absolute basic',
+ 'it_url::absolute basic'
);
$_SERVER['SERVER_PORT'] = 42;
is(
it_url::absolute("/port"),
'http://gna.ch:42/port',
- 'it_url::absolute with non-standard port',
+ 'it_url::absolute with non-standard port'
);
$_SERVER['HTTPS'] = true;
@@ -82,7 +82,7 @@ $_SERVER['SERVER_PORT'] = 443;
is(
it_url::absolute("/https"),
'https://gna.ch/https',
- 'it_url::absolute for https',
+ 'it_url::absolute for https'
);
?>
diff --git a/tests/it_xml.t b/tests/it_xml.t
index d805d8d..f74c54b 100755
--- a/tests/it_xml.t
+++ b/tests/it_xml.t
@@ -64,7 +64,7 @@ match(
match(
'<foo>&amp;amp; &lt;a&gt; &#38;amp; &#60;b&#62; &#x26;amp; &#x3C;c&#x3E; &uuml;</foo>',
'foo Object ( [val] => &amp; <a> &amp; <b> &amp; <c> ü ) ',
- 'Predecode illegal entities while keeping properly encoded ones',
+ 'Predecode illegal entities while keeping properly encoded ones'
);
match(
@@ -72,10 +72,18 @@ match(
utf8_encode('foo Object ( [val] => &amp; <a> &amp; <b> &amp; <c> ü ) '),
'Predecode illegal entities while keeping properly encoded ones (UTF-8)',
"",
- array('encoding' => "UTF-8"),
+ array('encoding' => "UTF-8")
);
+match(
+ "<foo>a\x05b</foo>",
+ 'foo Object ( [val] => a b ) ',
+ 'Illegal latin 1 character',
+ "",
+ array('encoding' => "ISO-8859-1")
+);
+
# Test inheritance
class my_xml extends it_xml
{
@@ -101,12 +109,12 @@ match(
'my'
);
-$x = new foo("<foo></foo>", 'prefix' => "test");
-$x->set('gna' => 42, 'bar' => array('baz' => array("qux", "quux")));
+$x = new foo("<foo></foo>", array('prefix' => "test"));
+$x->set(array('gna' => 42, 'bar' => array('baz' => array("qux", "quux"))));
match(
$x->to_xml(),
'foo Object ( [gna] => gna Object ( [val] => 42 ) [bar] => bar Object ( [baz] => Array ( [0] => baz Object ( [val] => qux ) [1] => baz Object ( [val] => quux ) ) ) ) ',
- "Method set()",
+ "Method set()"
);
?>