summaryrefslogtreecommitdiff
path: root/test/it_xml.t
diff options
context:
space:
mode:
authorChristian Schneider2020-09-15 13:20:03 +0200
committerChristian Schneider2020-09-15 13:20:03 +0200
commit79fd50e172a50918d9018f54ab6e40606181f95b (patch)
treec3292f632de47c825d16c55ca51a00ce68b4b3a4 /test/it_xml.t
parentf42d056812d4c1766d75bd8ab6d871e06a700302 (diff)
downloaditools-79fd50e172a50918d9018f54ab6e40606181f95b.tar.gz
itools-79fd50e172a50918d9018f54ab6e40606181f95b.tar.bz2
itools-79fd50e172a50918d9018f54ab6e40606181f95b.zip
Make itools PHP 8 compatible
Diffstat (limited to 'test/it_xml.t')
-rwxr-xr-xtest/it_xml.t24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/it_xml.t b/test/it_xml.t
index 27f910f..e21f052 100755
--- a/test/it_xml.t
+++ b/test/it_xml.t
@@ -3,7 +3,7 @@
# Tests for xml.class
-function match($xmldata, $expected, $name, $prefix = "", $p = [])
+function _match($xmldata, $expected, $name, $prefix = "", $p = [])
{
$classname = ($prefix ?: "it") . "_xml";
$varname = $prefix . "foo";
@@ -31,37 +31,37 @@ function match($xmldata, $expected, $name, $prefix = "", $p = [])
);
}
-match(
+_match(
'<foo />',
'foo Object ( ) ',
'empty tag'
);
-match(
+_match(
'<foo /><foo />',
'Array ( [0] => foo Object ( ) [1] => foo Object ( ) ) ',
'multiple empty tags converted to array'
);
-match(
+_match(
'<foo title="Zürich">Stüssihofstadt</foo>',
'foo Object ( [attr] => Array ( [title] => Zürich ) [val] => Stüssihofstadt ) ',
'simple tag with latin1 content and attribute'
);
-match(
+_match(
'<foo><ns:a.b.-c ns2:d.e-f="value" /></foo>',
'foo Object ( [a_b__c] => a_b__c Object ( [attr] => Array ( [d_e_f] => value ) ) ) ',
'Tags and attributes with name space and special characters'
);
-match(
+_match(
'<foo>x &amp; y</foo>',
'foo Object ( [val] => x & y ) ',
'Character data with entities'
);
-match(
+_match(
'<foo>x &uuml; y</foo>',
utf8_decode('foo Object ( [val] => x ü y ) '),
'Manual encoding override',
@@ -69,13 +69,13 @@ match(
['encoding' => "iso-8859-1"]
);
-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'
);
-match(
+_match(
'<foo>&amp;amp; &lt;a&gt; &#38;amp; &#60;b&#62; &#x26;amp; &#x3C;c&#x3E; &#xFC;</foo>',
utf8_decode('foo Object ( [val] => &amp; <a> &amp; <b> &amp; <c> ü ) '),
'Predecode illegal entities while keeping properly encoded ones (iso-8859-1)',
@@ -83,7 +83,7 @@ match(
['encoding' => "iso-8859-1"]
);
-match(
+_match(
"<foo>a\x05b</foo>",
'foo Object ( [val] => a b ) ',
'Illegal latin 1 character',
@@ -109,7 +109,7 @@ function __construct($xmldata)
}
-match(
+_match(
'<myfoo />',
'myfoo Object ( [inheritbaseclass] => ) ',
'Inheritance and constructor (critical for e.g. tel_xmlentry)',
@@ -118,7 +118,7 @@ match(
$x = new foo("<foo></foo>", ['prefix' => "test"]);
$x->set(['gna' => 42, 'bar' => ['baz' => ["qux", "quux"]]]);
-match(
+_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()"