From 35fe33f7364329dacf415c950bff01b6de9ef88e Mon Sep 17 00:00:00 2001
From: Christian Schneider
Date: Thu, 11 Oct 2007 00:39:30 +0000
Subject: Populated release branch
---
tests/it_xml.t | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100755 tests/it_xml.t
(limited to 'tests/it_xml.t')
diff --git a/tests/it_xml.t b/tests/it_xml.t
new file mode 100755
index 0000000..5651fbe
--- /dev/null
+++ b/tests/it_xml.t
@@ -0,0 +1,70 @@
+#!/www/server/bin/php -qC
+$xmldata");
+
+ is(
+ preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)),
+ $expected,
+ $name
+ );
+}
+
+match(
+ '',
+ 'foo Object ( ) ',
+ 'empty tag'
+);
+
+match(
+ '',
+ 'Array ( [0] => foo Object ( ) [1] => foo Object ( ) ) ',
+ 'multiple empty tags converted to array'
+);
+
+match(
+ 'Stüssihofstadt',
+ 'foo Object ( [attr] => Array ( [title] => Zürich ) [val] => Stüssihofstadt ) ',
+ 'simple tag with latin1 content and attribute'
+);
+
+match(
+ '',
+ 'foo Object ( [a_b__c] => a_b__c Object ( [attr] => Array ( [d_e_f] => value ) ) ) ',
+ 'Tags and attributes with name space and special characters'
+);
+
+# Test inheritance
+class my_xml extends it_xml
+{
+
+function my_xml($xmldata)
+{
+ parent::it_xml($xmldata);
+
+ # Code which should be executed in root and only there
+ $this->qux = new it_xml;
+ $this->qux->val = "qux";
+
+ if (is_object($this->myfoo))
+ $this->myfoo->inheritbaseclass = is_a($this->myfoo, "my_xml");
+}
+
+}
+
+match(
+ '',
+ 'myfoo Object ( [inheritbaseclass] => ) ',
+ 'Inheritance and constructor (critical for e.g. tel_xmlentry)',
+ 'my'
+);
+
+?>
--
cgit v1.2.3