1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 03:22:58 +02:00
Files
archived-php-src/ext/dom/tests/bug76285.phpt
Andrew Nester 2072d377d3 DOMDocument::formatOutput attribute sometimes ignored
(cherry picked from commit ef9ed19ec7)
2018-08-17 13:01:55 +02:00

22 lines
669 B
PHP

--TEST--
Bug #76285 DOMDocument::formatOutput attribute sometimes ignored
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php if (!defined("LIBXML_HTML_NOIMPLIED")) die("skip libxml2 2.7.7 required"); ?>
--FILE--
<?php
$dom = new DOMDocument();
$dom->formatOutput = false;
$html = '<div><div><a>test</a></div><div><a>test2</a></div></div>';
$dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$rootNode = $dom->documentElement;
var_dump($dom->saveHTML($rootNode));
var_dump($dom->saveHTML());
?>
--EXPECT--
string(56) "<div><div><a>test</a></div><div><a>test2</a></div></div>"
string(57) "<div><div><a>test</a></div><div><a>test2</a></div></div>
"