1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/xmlwriter/tests/bug79344.phpt
Christoph M. Becker aa754ba85e FR #79344: xmlwriter_write_attribute_ns: $prefix should be nullable
The `$prefix` parameter of `xmlwriter_write_element_ns()` and
`xmlwriter_start_element_ns()` is nullable, what allows these functions
to be used instead of their non NS variants.  Consequently, we make the
`$prefix` parameter of `xmlwriter_write_attribute_ns()` and
`xmlwriter_start_attribute_ns()` nullable as well.
2020-06-16 15:50:01 +02:00

24 lines
558 B
PHP

--TEST--
FR #79344 (xmlwriter_write_attribute_ns: $prefix should be nullable)
--SKIPIF--
<?php
if (!extension_loaded('xmlwriter')) die('skip xmlwriter extension not available');
?>
--FILE--
<?php
$writer = new XMLWriter;
$writer->openMemory();
$writer->setIndent(true);
$writer->startElement('foo');
$writer->writeAttributeNS(null, 'test1', null, 'test1');
$writer->startAttributeNS(null, 'test2', null);
$writer->text('test2');
$writer->endAttribute();
$writer->endElement();
echo $writer->outputMemory();
?>
--EXPECT--
<foo test1="test1" test2="test2"/>