1--TEST--
2DOMDocument::saveHTMLFile() should dump the internal document into a file using HTML formatting
3--CREDITS--
4Knut Urdalen <knut@php.net>
5#PHPTestFest2009 Norway 2009-06-09 \o/
6--SKIPIF--
7<?php
8require_once dirname(__FILE__) .'/skipif.inc';
9?>
10--FILE--
11<?php
12$filename = dirname(__FILE__)."/tmp_savehtmlfile".time().".html";
13$doc = new DOMDocument('1.0');
14$root = $doc->createElement('html');
15$root = $doc->appendChild($root);
16$head = $doc->createElement('head');
17$head = $root->appendChild($head);
18$title = $doc->createElement('title');
19$title = $head->appendChild($title);
20$text = $doc->createTextNode('This is the title');
21$text = $title->appendChild($text);
22$bytes = $doc->saveHTMLFile($filename);
23var_dump($bytes);
24echo file_get_contents($filename);
25unlink($filename);
26?>
27--EXPECTF--
28int(126)
29<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>This is the title</title></head></html>
30