From 6943a9f3bc10a60fcc01f126dfbd22b24b9c99cb Mon Sep 17 00:00:00 2001
From: Christian Schneider
Date: Thu, 8 Feb 2007 14:51:25 +0000
Subject: Moved ITools tests from searchlib to itools/live
---
tests/it_xml.t | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 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..06df969
--- /dev/null
+++ b/tests/it_xml.t
@@ -0,0 +1,66 @@
+#!/www/server/bin/php -qC
+$xmldata");
+
+ is(
+ preg_replace('/[#\s]+/', " ", search_test::dump($xml->$varname)),
+ $expected,
+ $name,
+ );
+}
+
+match(
+ '',
+ 'class foo { }',
+ 'empty tag'
+);
+
+#match(
+# '',
+# 'array ( 0 => class foo { }, 1 => class foo { }, )',
+# 'multiple empty tags converted to array'
+#);
+
+match(
+ 'Stüssihofstadt',
+ 'class foo { var $attr = array( \'title\' => \'Zürich\' ); var $val = \'Stüssihofstadt\'; }',
+ 'simple tag with latin1 content and attribute'
+);
+
+# 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->properbaseclass = is_a($this->myfoo, "my_xml");
+}
+
+}
+
+match(
+ '',
+ 'class myfoo { var $properbaseclass = true; }',
+ 'Inheritance and constructor',
+ 'my'
+);
+
+?>
--
cgit v1.2.3