]> granicus.if.org Git - php/commitdiff
Replace EXPECTF by EXPECT
authorFabien Villepinte <fabien.villepinte@gmail.com>
Sat, 26 Oct 2019 14:05:02 +0000 (16:05 +0200)
committerFabien Villepinte <fabien.villepinte@gmail.com>
Sat, 26 Oct 2019 14:05:02 +0000 (16:05 +0200)
In ext/dom all the tests with a EXPECTF section
starting by "Fatal error: Uncaught" have been updated
to use the faster EXPECT

ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt
ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt
ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt
ext/dom/tests/DOMDocument_saveHTML_error2.phpt
ext/dom/tests/DOMDocument_validate_error2.phpt
ext/dom/tests/regsiter_node_class.phpt

index 2faa02eb582aa9f39aeb65d14ae46cf73c87b06a..a4c6fbc73e901ee25520a58432d71a8976a243ff 100644 (file)
@@ -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
index b6ce9dcb65390996998bbda4b95ef9c92f1d84bb..4e7e28f298d4506b5ef9d8c5ec3a502376150538 100644 (file)
@@ -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
index aa25bb16e78c167aefdddcbe20e794f871685ece..6cacaded4c4793700503c85b381b9be1193ac337 100644 (file)
@@ -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
index 83aefd5ba801472578c89a70fe5ace6c08b4e377..8f686e96059719a3a3ccc2b1e651de4006b337c4 100644 (file)
@@ -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
index c6d03bf02d45f0fb0b205a7403a35aeaa1b7d160..36d28bcbacff90f60db1377a5638b642dc616da1 100644 (file)
@@ -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
index 1511a1e5072b91864f7e8656ab827b0606166d61..09b01aeea443fe92fc7430e6db996600f22ae2ef 100644 (file)
@@ -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()