- MFH: fix tests, libxml 2.6.24 and up adds a new line after a processing

instruction (PI)
This commit is contained in:
Pierre Joye 2006-07-19 18:58:06 +00:00
parent d4be83b5c4
commit 93d4de150e
2 changed files with 10 additions and 6 deletions

View file

@ -8,7 +8,9 @@ if (!function_exists("xmlwriter_start_comment")) die("skip: libxml2 2.6.7+ requi
--FILE-- --FILE--
<?php <?php
/* $Id$ */ /* $Id$ */
/*
Libxml 2.6.24 and up adds a new line after a processing instruction (PI)
*/
$xw = xmlwriter_open_memory(); $xw = xmlwriter_open_memory();
xmlwriter_set_indent($xw, TRUE); xmlwriter_set_indent($xw, TRUE);
xmlwriter_start_document($xw, NULL, "UTF-8"); xmlwriter_start_document($xw, NULL, "UTF-8");
@ -32,12 +34,12 @@ xmlwriter_end_document($xw);
$output = xmlwriter_flush($xw, true); $output = xmlwriter_flush($xw, true);
print $output; print $output;
?> ?>
--EXPECT-- --EXPECTF--
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<root id="elem1"> <root id="elem1">
<elem1 attr1="first"> <elem1 attr1="first">
<!--start PI--> <!--start PI-->
<pi><?php echo "hello world"; ?></pi> <pi><?php echo "hello world"; ?>%w</pi>
<cdata><![CDATA[<>&"]]></cdata> <cdata><![CDATA[<>&"]]></cdata>
</elem1> </elem1>
</root> </root>

View file

@ -7,7 +7,9 @@ if (!extension_loaded("xmlwriter")) die("skip");
--FILE-- --FILE--
<?php <?php
/* $Id$ */ /* $Id$ */
/*
Libxml 2.6.24 and up adds a new line after a processing instruction (PI)
*/
$xw = new XMLWriter(); $xw = new XMLWriter();
$xw->openMemory(); $xw->openMemory();
$xw->setIndent(TRUE); $xw->setIndent(TRUE);
@ -32,12 +34,12 @@ $xw->endDocument();
$output = $xw->flush(true); $output = $xw->flush(true);
print $output; print $output;
?> ?>
--EXPECT-- --EXPECTF--
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<root id="elem1"> <root id="elem1">
<elem1 attr1="first"> <elem1 attr1="first">
<!--start PI--> <!--start PI-->
<pi><?php echo "hello world"; ?></pi> <pi><?php echo "hello world"; ?>%w</pi>
<cdata><![CDATA[<>&"]]></cdata> <cdata><![CDATA[<>&"]]></cdata>
</elem1> </elem1>
</root> </root>