com php-src: Run arginfo / zpp mismatch tests for methods as well: Zend/tests/arginfo_zpp_mismatch.phpt
| From: | Nikita Popov | Date: | Tue, 21 Jul 2020 12:17:29 +0000 |
| Subject: | com php-src: Run arginfo / zpp mismatch tests for methods as well: Zend/tests/arginfo_zpp_mismatch.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112290@lists.php.net to get a copy of this message | ||
Commit: c9881fde7ad7536c079a206cd33d4f96d7238214
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 17 Jul 2020 15:50:06 +0200
Parents: 38fb1f83839ceb04de92a3b6eb75cdf37d7686bb
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c9881fde7ad7536c079a206cd33d4f96d7238214
Log:
Run arginfo / zpp mismatch tests for methods as well
As a side-effect, this also catches issues where classes are not
prepared for use with newInstanceWithoutConstructor.
Changed paths:
M Zend/tests/arginfo_zpp_mismatch.phpt
Diff:
diff --git a/Zend/tests/arginfo_zpp_mismatch.phpt b/Zend/tests/arginfo_zpp_mismatch.phpt
index 9762dd5fce..39a1742743 100644
--- a/Zend/tests/arginfo_zpp_mismatch.phpt
+++ b/Zend/tests/arginfo_zpp_mismatch.phpt
@@ -3,10 +3,27 @@ Test that there is no arginfo/zpp mismatch
--FILE--
<?php
-foreach (get_defined_functions()["internal"] as $function) {
+function test($function) {
try {
@$function(null, null, null, null, null, null, null, null);
- } catch (ArgumentCountError|Error) {
+ } catch (Throwable) {
+ }
+}
+
+foreach (get_defined_functions()["internal"] as $function) {
+ test($function);
+}
+
+foreach (get_declared_classes() as $class) {
+ try {
+ $rc = new ReflectionClass($class);
+ $obj = $rc->newInstanceWithoutConstructor();
+ } catch (Throwable) {
+ continue;
+ }
+
+ foreach (get_class_methods($class) as $method) {
+ test([$obj, $method]);
}
}