1--TEST--
2SimpleXMLElement::asXML() with a fragment and a filename
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8$sxe = simplexml_load_string(<<<XML
9<?xml version="1.0"?>
10<container>
11    <container2>
12        <child id="foo">bar</child>
13    </container2>
14</container>
15XML);
16$sxe->container2->asXML(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
17
18// Note: the strange indent is correct: the indent text node preceding container2 is not emitted.
19echo file_get_contents(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
20
21?>
22--CLEAN--
23<?php
24@unlink(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
25?>
26--EXPECT--
27<container2>
28        <child id="foo">bar</child>
29    </container2>
30