com php-src: Replace EXPECTF by EXPECT: ext/dom/tests/DOMCharac terData_deleteData_error_002.phpt ext/dom/tests
/DOMDocumentFragment_appendXML_error_002.phpt e xt/dom/tests/DOMDocument_saveHTMLFile_error2.phpt ext /dom/tests/DOMDocument_saveHTML_error2.phpt
ext/dom/t ests/DOMDocument_validate_error2.phpt ext/dom/tests/r egsiter_node_class.phpt
| From: | Fabien Villepinte | Date: | Sat, 26 Oct 2019 14:05:02 +0000 |
| Subject: | com php-src: Replace EXPECTF by EXPECT: ext/dom/tests/DOMCharac terData_deleteData_error_002.phpt ext/dom/tests /DOMDocumentFragment_appendXML_error_002.phpt e xt/dom/tests/DOMDocument_saveHTMLFile_error2.phpt ext /dom/tests/DOMDocument_saveHTML_error2.phpt ext/dom/t ests/DOMDocument_validate_error2.phpt ext/dom/tests/r egsiter_node_class.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109070@lists.php.net to get a copy of this message | ||
Commit: 601aef346863bbecee7ca468a8418d05d99d6d13
Author: Fabien Villepinte <fabien.villepinte@gmail.com> Sat, 26 Oct 2019 16:05:02
+0200
Parents: bd379df48c1568b19d267f642154f386bd864cba
Branches: PHP-7..4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=601aef346863bbecee7ca468a8418d05d99d6d13
Log:
Replace EXPECTF by EXPECT
In ext/dom all the tests with a EXPECTF section
starting by "Fatal error: Uncaught" have been updated
to use the faster EXPECT
Changed paths:
M ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
M ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
M ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
M ext/dom/tests/DOMDocument_saveHTML_error2.phpt
M ext/dom/tests/DOMDocument_validate_error2.phpt
M ext/dom/tests/regsiter_node_class.phpt
Diff:
diff --git a/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
b/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
index 2faa02eb582..a4c6fbc73e9 100644
--- a/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
+++ b/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
@@ -13,11 +13,11 @@ $document->appendChild($root);
$cdata = $document->createCDATASection('test');
$root->appendChild($cdata);
-$cdata->deleteData(5, 1);
+try {
+ $cdata->deleteData(5, 1);
+} catch (DOMException $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
-Fatal error: Uncaught DOMException: Index Size Error in %s:%d
-Stack trace:
-#0 %s(%d): DOMCharacterData->deleteData(5, 1)
-#1 {main}
- thrown in %s on line %d
+--EXPECT--
+Index Size Error
diff --git a/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
b/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
index b6ce9dcb653..4e7e28f298d 100644
--- a/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
+++ b/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
@@ -8,12 +8,11 @@ Eric Lee Stewart <ericleestewart@gmail.com>
--FILE--
<?php
$fragment = new DOMDocumentFragment();
-$fragment->appendXML('<bait>crankbait</bait>');
-$document->appendChild($fragment);
+try {
+ $fragment->appendXML('<bait>crankbait</bait>');
+} catch (DOMException $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
-Fatal error: Uncaught DOMException: No Modification Allowed Error in %s:%d
-Stack trace:
-#0 %s(%d): DOMDocumentFragment->appendXML('<bait>crankbait...')
-#1 {main}
- thrown in %s on line %d
+--EXPECT--
+No Modification Allowed Error
diff --git a/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
b/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
index aa25bb16e78..6cacaded4c4 100644
--- a/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
+++ b/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
@@ -9,10 +9,11 @@ require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
-DOMDocument::saveHTMLFile();
+try {
+ DOMDocument::saveHTMLFile();
+} catch (Error $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
-Fatal error: Uncaught Error: Non-static method DOMDocument::saveHTMLFile() cannot be called
statically in %s:%d
-Stack trace:
-#0 {main}
- thrown in %s on line %d
+--EXPECT--
+Non-static method DOMDocument::saveHTMLFile() cannot be called statically
diff --git a/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
b/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
index 83aefd5ba80..8f686e96059 100644
--- a/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
+++ b/ext/dom/tests/DOMDocument_saveHTML_error2.phpt
@@ -9,10 +9,11 @@ require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
-DOMDocument::saveHTML(true);
+try {
+ DOMDocument::saveHTML(true);
+} catch (Error $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
-Fatal error: Uncaught Error: Non-static method DOMDocument::saveHTML() cannot be called statically
in %s:%d
-Stack trace:
-#0 {main}
- thrown in %s on line %d
+--EXPECT--
+Non-static method DOMDocument::saveHTML() cannot be called statically
diff --git a/ext/dom/tests/DOMDocument_validate_error2.phpt
b/ext/dom/tests/DOMDocument_validate_error2.phpt
index c6d03bf02d4..36d28bcbacf 100644
--- a/ext/dom/tests/DOMDocument_validate_error2.phpt
+++ b/ext/dom/tests/DOMDocument_validate_error2.phpt
@@ -9,10 +9,11 @@ require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
-DOMDocument::validate();
+try {
+ DOMDocument::validate();
+} catch (Error $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
-Fatal error: Uncaught Error: Non-static method DOMDocument::validate() cannot be called statically
in %s:%d
-Stack trace:
-#0 {main}
- thrown in %s on line %d
+--EXPECT--
+Non-static method DOMDocument::validate() cannot be called statically
diff --git a/ext/dom/tests/regsiter_node_class.phpt b/ext/dom/tests/regsiter_node_class.phpt
index 1511a1e5072..09b01aeea44 100644
--- a/ext/dom/tests/regsiter_node_class.phpt
+++ b/ext/dom/tests/regsiter_node_class.phpt
@@ -27,16 +27,16 @@ unset($attr);
$doc->registerNodeClass('DOMAttr', NULL);
$attr = $root->getAttributeNode('a');
echo get_class($attr), "\n";
-print $attr->testit()."\n";
+try {
+ print $attr->testit()."\n";
+} catch (Error $e) {
+ echo $e->getMessage();
+}
?>
---EXPECTF--
+--EXPECT--
myElement
HELLO Element
myAttribute
HELLO Attribute
DOMAttr
-
-Fatal error: Uncaught Error: Call to undefined method DOMAttr::testit() in %s:25
-Stack trace:
-#0 {main}
- thrown in %s on line 25
+Call to undefined method DOMAttr::testit()