diff options
author | Christian Schneider | 2007-07-15 14:26:40 +0000 |
---|---|---|
committer | Christian Schneider | 2007-07-15 14:26:40 +0000 |
commit | 4c3b61356b9fe001c5637c30f6105a208f4dffc3 (patch) | |
tree | 8e02bd700571e02ebc9eac53aa2c9dc14db398d9 /tests | |
parent | ece30e7e6d98ee2e8050ee493d79d63efc6f1d5e (diff) | |
download | itools-4c3b61356b9fe001c5637c30f6105a208f4dffc3.tar.gz itools-4c3b61356b9fe001c5637c30f6105a208f4dffc3.tar.bz2 itools-4c3b61356b9fe001c5637c30f6105a208f4dffc3.zip |
Make itools tests work under PHP4 and PHP5
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/itjs.t | 2 | ||||
-rwxr-xr-x | tests/xml.t | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/itjs.t b/tests/itjs.t index 7fa6b03..4b4b0c8 100755 --- a/tests/itjs.t +++ b/tests/itjs.t @@ -19,7 +19,7 @@ is( is( itjs::serialize(array(null, "", false)), - '["", "", ""]', + '["", "", false]', 'null, empty string, false' ); diff --git a/tests/xml.t b/tests/xml.t index 8e72a77..5d652cc 100755 --- a/tests/xml.t +++ b/tests/xml.t @@ -12,7 +12,7 @@ function match($xmldata, $expected, $name, $prefix = "") $xml = new $classname("<root>$xmldata</root>"); is( - preg_replace('/[#\s]+/', " ", search_test::dump($xml->$varname)), + preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)), $expected, $name, ); @@ -20,25 +20,25 @@ function match($xmldata, $expected, $name, $prefix = "") match( '<foo />', - 'class foo { }', + 'foo Object ( ) ', 'empty tag' ); match( '<foo /><foo />', - 'array ( 0 => class foo { }, 1 => class foo { }, )', + 'Array ( [0] => foo Object ( ) [1] => foo Object ( ) ) ', 'multiple empty tags converted to array' ); match( '<foo title="Zürich">Stüssihofstadt</foo>', - 'class foo { var $attr = array( \'title\' => \'Zürich\' ); var $val = \'Stüssihofstadt\'; }', + 'foo Object ( [attr] => Array ( [title] => Zürich ) [val] => Stüssihofstadt ) ', 'simple tag with latin1 content and attribute' ); match( '<foo><ns:a.b.-c ns2:d.e-f="value" /></foo>', - 'class foo { var $a_b__c = class a_b__c { var $attr = array( \'d_e_f\' => \'value\' ); }; }', + 'foo Object ( [a_b__c] => a_b__c Object ( [attr] => Array ( [d_e_f] => value ) ) ) ', 'Tags and attributes with name space and special characters' ); @@ -62,7 +62,7 @@ function my_xml($xmldata) match( '<myfoo />', - 'class myfoo { var $inheritbaseclass = false; }', + 'myfoo Object ( [inheritbaseclass] => ) ', 'Inheritance and constructor (critical for e.g. tel_xmlentry)', 'my' ); |