felipe          Thu Jul  2 00:04:52 2009 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/dom/tests      DOMDocument_createEntityReference_basic.phpt 
                                DOMDocument_saveHTMLFile_basic.phpt 
                                DOMDocument_saveHTMLFile_error1.phpt 
                                DOMDocument_saveHTMLFile_error2.phpt 
                                DOMDocument_saveHTMLFile_formatOutput.phpt 
                                DOMDocument_saveHTMLFile_invalid_filename.phpt 
                                DOMDocument_saveHTML_basic.phpt 
                                DOMDocument_saveHTML_error1.phpt 
                                DOMDocument_saveHTML_error2.phpt 
                                DOMDocument_validate_basic.phpt 
                                DOMDocument_validate_error1.phpt 
                                DOMDocument_validate_error2.phpt 
                                DOMDocument_validate_external_dtd.phpt 
  Log:
  - MFH: New tests (NorwayUG testfest)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_createEntityReference_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_createEntityReference_basic.phpt
+++ php-src/ext/dom/tests/DOMDocument_createEntityReference_basic.phpt
--TEST--
DOMDocument::createEntityReference() should create a new entity reference node
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$dom = new DOMDocument('1.0');
$ref = $dom->createEntityReference('nbsp');
$dom->appendChild($ref);
echo $dom->saveXML();
?>
--EXPECTF--
<?xml version="1.0"?>
&nbsp;

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTMLFile_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTMLFile_basic.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTMLFile_basic.phpt
--TEST--
DOMDocument::saveHTMLFile() should dump the internal document into a file using 
HTML formatting
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$filename = dirname(__FILE__)."/tmp_savehtmlfile".time().".html";
$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);
$bytes = $doc->saveHTMLFile($filename);
var_dump($bytes);
echo file_get_contents($filename);
unlink($filename);
?>
--EXPECTF--
int(126)
<html><head><meta http-equiv="Content-Type" content="text/html; 
charset=UTF-8"><title>This is the title</title></head></html>

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error1.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error1.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error1.phpt
--TEST--
DOMDocument::saveHTMLFile() should fail if no parameter is given
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--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);
$doc->saveHTMLFile();
?>
--EXPECTF--
Warning: DOMDocument::saveHTMLFile() expects exactly 1 parameter, 0 given in %s 
on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
--TEST--
DOMDocument::saveHTMLFile() should fail if called statically
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
DOMDocument::saveHTMLFile();
?>
--EXPECTF--
Fatal error: Non-static method DOMDocument::saveHTMLFile() cannot be called 
statically in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTMLFile_formatOutput.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTMLFile_formatOutput.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTMLFile_formatOutput.phpt
--TEST--
DOMDocument::saveHTMLFile() should format output on demand
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$filename = dirname(__FILE__)."/tmp_savehtmlfile".time().".html";
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$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);
$bytes = $doc->saveHTMLFile($filename);
var_dump($bytes);
echo file_get_contents($filename);
unlink($filename);
?>
--EXPECTF--
int(129)
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>This is the title</title>
</head></html>

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt
--TEST--
DOMDocument::saveHTMLFile() should fail with invalid filename
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$filename = null;
$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);
$bytes = $doc->saveHTMLFile($filename);
?>
--EXPECTF--
Warning: DOMDocument::saveHTMLFile(): Invalid Filename in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTML_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTML_basic.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTML_basic.phpt
--TEST--
DOMDocument::saveHTML() should dump the internal document into a string using 
HTML formatting 
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--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();
?>
--EXPECTF--
<html><head><title>This is the title</title></head></html>

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTML_error1.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTML_error1.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTML_error1.phpt
--TEST--
DOMDocument::saveHTML() should fail if a parameter is given
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--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(true);
?>
--EXPECTF--
Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in %s on 
line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_saveHTML_error2.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
+++ php-src/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
--TEST--
DOMDocument::saveHTML() should fail if called statically
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
DOMDocument::saveHTML(true);
?>
--EXPECTF--
Fatal error: Non-static method DOMDocument::saveHTML() cannot be called 
statically in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_validate_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_validate_basic.phpt
+++ php-src/ext/dom/tests/DOMDocument_validate_basic.phpt
--TEST--
DOMDocument::validate() should validate an internal DTD declaration
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$xml = "<?xml version=\"1.0\"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>";
$dom = new DOMDocument('1.0');
$dom->loadXML($xml);
var_dump($dom->validate());
?>
--EXPECTF--
bool(true)

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_validate_error1.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_validate_error1.phpt
+++ php-src/ext/dom/tests/DOMDocument_validate_error1.phpt
--TEST--
DOMDocument::validate() should fail if any parameter is given
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
$dom = new DOMDocument('1.0');
$dom->validate(true);
?>
--EXPECTF--
Warning: DOMDocument::validate() expects exactly 0 parameters, 1 given in %s on 
line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_validate_error2.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_validate_error2.phpt
+++ php-src/ext/dom/tests/DOMDocument_validate_error2.phpt
--TEST--
DOMDocument::validate() should fail if called statically
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
DOMDocument::validate();
?>
--EXPECTF--
Fatal error: Non-static method DOMDocument::validate() cannot be called 
statically in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_validate_external_dtd.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
+++ php-src/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
--TEST--
DOMDocument::validate() should validate an external DTD declaration
--CREDITS--
Knut Urdalen <k...@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
// reusing existing xml: 
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/dom.xml?view=co&content-type=text%2Fplain
// reusing existing dtd: 
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/dom.ent?view=co&content-type=text%2Fplain
$dom = new DOMDocument('1.0');
$dom->load(dirname(__FILE__).'/dom.xml');
var_dump($dom->validate());
?>
--EXPECTF--
bool(true)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to