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--EXTENSIONS--
7dom
8--FILE--
9<?php
10$filename = __DIR__."/DOMDocument_saveHTMLFile_basic.html";
11$doc = new DOMDocument('1.0');
12$root = $doc->createElement('html');
13$root = $doc->appendChild($root);
14$head = $doc->createElement('head');
15$head = $root->appendChild($head);
16$title = $doc->createElement('title');
17$title = $head->appendChild($title);
18$text = $doc->createTextNode('This is the title');
19$text = $title->appendChild($text);
20$bytes = $doc->saveHTMLFile($filename);
21var_dump($bytes);
22echo file_get_contents($filename);
23unlink($filename);
24?>
25--EXPECT--
26int(126)
27<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>This is the title</title></head></html>
28