php-src/ext/dom/tests/DOMDocument_saveHTML_variant1.phpt

25 lines
649 B
Plaintext
Raw Normal View History

2009-07-02 00:01:20 +00:00
--TEST--
DOMDocument::saveHTML() optional parameters
2009-07-02 00:01:20 +00:00
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
2009-07-02 00:01:20 +00:00
?>
--FILE--
<?php
$doc = new DOMDocument('1.0');
$root = $doc->createElement('html');
$root = $doc->appendChild($root);
$head = $doc->createElement('head');
$head = $root->appendChild($head);
$title = $doc->createElement('title');
$title = $head->appendChild($title);
$text = $doc->createTextNode('This is the title');
$text = $title->appendChild($text);
echo $doc->saveHTML(NULL), "\n";
echo $doc->saveHTML($title), "\n";
2009-07-02 00:01:20 +00:00
?>
--EXPECTF--
<html><head><title>This is the title</title></head></html>
<title>This is the title</title>