]> granicus.if.org Git - php/commitdiff
Add simple parsing test
authorMarcus Boerger <helly@php.net>
Tue, 29 Oct 2002 16:04:42 +0000 (16:04 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 29 Oct 2002 16:04:42 +0000 (16:04 +0000)
ext/domxml/tests/skipif.inc [new file with mode: 0644]
ext/domxml/tests/xmldoc.phpt [new file with mode: 0644]

diff --git a/ext/domxml/tests/skipif.inc b/ext/domxml/tests/skipif.inc
new file mode 100644 (file)
index 0000000..8498b5b
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+       if (!extension_loaded('domxml')) die('skip domxml extension not available');
+?>
diff --git a/ext/domxml/tests/xmldoc.phpt b/ext/domxml/tests/xmldoc.phpt
new file mode 100644 (file)
index 0000000..244f289
--- /dev/null
@@ -0,0 +1,35 @@
+--TEST--
+xmldoc()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+require_once("domxml_test.inc");
+
+$dom = xmldoc($xmlstr);
+if(!$dom) {
+  die('Error while parsing the document');
+}
+var_dump($dom);
+?>
+--EXPECTF--
+object(domdocument)(9) {
+  ["name"]=>
+  string(9) "#document"
+  ["url"]=>
+  string(0) ""
+  ["version"]=>
+  string(3) "1.0"
+  ["standalone"]=>
+  int(1)
+  ["type"]=>
+  int(9)
+  ["compression"]=>
+  int(-1)
+  ["charset"]=>
+  int(1)
+  [0]=>
+  int(5)
+  [1]=>
+  int(%d)
+}
\ No newline at end of file