MFH: fix res parameter typos

- add test
This commit is contained in:
Rob Richards 2005-12-07 05:09:33 +00:00
parent 2796160d15
commit 5b561a6df3
2 changed files with 30 additions and 2 deletions

View 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;
}

View File

@ -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>