]> granicus.if.org Git - php/commitdiff
MFH: fix res parameter typos
authorRob Richards <rrichards@php.net>
Wed, 7 Dec 2005 05:09:33 +0000 (05:09 +0000)
committerRob Richards <rrichards@php.net>
Wed, 7 Dec 2005 05:09:33 +0000 (05:09 +0000)
- add test

ext/xmlwriter/php_xmlwriter.c
ext/xmlwriter/tests/OO_006.phpt [new file with mode: 0644]

index 5ce3b97af903b3ace4342738e7967594c2ce6b28..f44a6b26fb270eaf77a732711f00dc796981400d 100644 (file)
@@ -823,7 +823,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns)
        zval *this = getThis();
        
        if (this) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", 
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", 
                        &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
                        return;
                }
@@ -1223,7 +1223,7 @@ PHP_FUNCTION(xmlwriter_start_dtd)
        zval *this = getThis();
 
        if (this) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
                        return;
                }
 
diff --git a/ext/xmlwriter/tests/OO_006.phpt b/ext/xmlwriter/tests/OO_006.phpt
new file mode 100644 (file)
index 0000000..debaa17
--- /dev/null
@@ -0,0 +1,28 @@
+--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 = new XMLWriter();
+$xw->openUri($doc_dest);
+$xw->startDtd('foo', NULL, 'urn:bar');
+$xw->endDtd();
+$xw->startElement('foo');
+$xw->writeElementNS('foo', 'bar', 'urn:foo', 'dummy content');
+$xw->endElement();
+
+// Force to write and empty the buffer
+$output_bytes = $xw->flush(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>