summaryrefslogtreecommitdiff
path: root/ext/xmlwriter/tests/006.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xmlwriter/tests/006.phpt')
-rw-r--r--ext/xmlwriter/tests/006.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/xmlwriter/tests/006.phpt b/ext/xmlwriter/tests/006.phpt
new file mode 100644
index 0000000..3b290ad
--- /dev/null
+++ b/ext/xmlwriter/tests/006.phpt
@@ -0,0 +1,27 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, startDTD/writeElementNS
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (!function_exists("xmlwriter_start_comment")) die("skip: libxml2 2.6.7+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$doc_dest = '001.xml';
+$xw = xmlwriter_open_uri($doc_dest);
+xmlwriter_start_dtd($xw, 'foo', NULL, 'urn:bar');
+xmlwriter_end_dtd($xw);
+xmlwriter_start_element($xw, 'foo');
+xmlwriter_write_element_ns($xw, 'foo', 'bar', 'urn:foo', 'dummy content');
+xmlwriter_end_element($xw);
+
+// Force to write and empty the buffer
+$output_bytes = xmlwriter_flush($xw, true);
+echo file_get_contents($doc_dest);
+unset($xw);
+unlink('001.xml');
+?>
+--EXPECT--
+<!DOCTYPE foo SYSTEM "urn:bar"><foo><foo:bar xmlns:foo="urn:foo">dummy content</foo:bar></foo>