1--TEST-- 2DOM Document : save and saveXML 3--CREDITS-- 4Sami Greenbury (sami@patabugen.co.uk) 5# TestFest 2008 6--EXTENSIONS-- 7dom 8--FILE-- 9<?php 10 11$xml = <<< EOXML 12<?xml version="1.0" encoding="utf-8"?> 13<courses> 14 <!-- Hello World! --> 15 <aNode> 16 <childNode> 17 <childlessNode /> 18 </childNode> 19 </aNode> 20</courses> 21EOXML; 22 23$dom = new DOMDocument(); 24$dom->loadXML($xml); 25$root = $dom->documentElement; 26$directory = __DIR__; 27 28$filename = $directory."/tmp_dom_savexml".time(); 29var_dump($dom->save($filename)); 30$result = file_get_contents($filename); 31var_dump($result == $dom->saveXML()); 32 33unlink($filename); 34?> 35--EXPECT-- 36int(181) 37bool(true) 38