diff options
| author | jhdxr <jhdxr@php.net> | 2017-01-30 17:48:00 +0800 |
|---|---|---|
| committer | Joe Watkins <krakjoe@php.net> | 2017-01-30 11:25:04 +0000 |
| commit | 62938bf08806129b42b17e74d79a450c30d4ff30 (patch) | |
| tree | 81f1ae1c7460826c124b3dbe8428b8f744c8338a /ext/dom/tests | |
| parent | 4b1afc829c0d2a3fec999dbe7c32377b5ee91803 (diff) | |
| download | php-git-62938bf08806129b42b17e74d79a450c30d4ff30.tar.gz | |
fix BC break introduced by #2346 (sebastianbergmann/phpunit#2454)
Diffstat (limited to 'ext/dom/tests')
| -rw-r--r-- | ext/dom/tests/DOMDocument_savexml_basic2.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMDocument_savexml_basic2.phpt b/ext/dom/tests/DOMDocument_savexml_basic2.phpt new file mode 100644 index 0000000000..7c01014808 --- /dev/null +++ b/ext/dom/tests/DOMDocument_savexml_basic2.phpt @@ -0,0 +1,33 @@ +--TEST-- +DOM Document: saveXML with createElement and formatOutput +--CREDITS-- +CHU Zhaowei <jhdxr@php.net> +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$dom = new domDocument('1.0', 'UTF-8'); +$dom->formatOutput = true; + +$root = $dom->createElement('root'); +$dom->appendChild($root); + +$child1 = $dom->createElement('testsuite'); +$root->appendChild($child1); + +$child11 = $dom->createElement('testcase'); +$child11->setAttribute('name', 'leaf1'); +$child12 = $dom->createElement('testcase'); +$child12->setAttribute('name', 'leaf2'); +$child1->appendChild($child11); +$child1->appendChild($child12); + +echo $dom->saveXml(); +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<root> + <testsuite> + <testcase name="leaf1"/> + <testcase name="leaf2"/> + </testsuite> +</root>
\ No newline at end of file |
