mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
MFH: fix res parameter typos
- add test
This commit is contained in:
parent
2796160d15
commit
5b561a6df3
@ -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;
|
||||
}
|
||||
|
||||
|
28
ext/xmlwriter/tests/OO_006.phpt
Normal file
28
ext/xmlwriter/tests/OO_006.phpt
Normal 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>
|
Loading…
Reference in New Issue
Block a user