xref: /PHP-8.0/ext/xmlwriter/tests/bug79344.phpt (revision aa754ba8)
1--TEST--
2FR #79344 (xmlwriter_write_attribute_ns: $prefix should be nullable)
3--SKIPIF--
4<?php
5if (!extension_loaded('xmlwriter')) die('skip xmlwriter extension not available');
6?>
7--FILE--
8<?php
9$writer = new XMLWriter;
10$writer->openMemory();
11$writer->setIndent(true);
12$writer->startElement('foo');
13
14$writer->writeAttributeNS(null, 'test1', null, 'test1');
15$writer->startAttributeNS(null, 'test2', null);
16$writer->text('test2');
17$writer->endAttribute();
18
19$writer->endElement();
20echo $writer->outputMemory();
21?>
22--EXPECT--
23<foo test1="test1" test2="test2"/>
24