mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
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.
This commit is contained in:
parent
38fb1f8383
commit
c9881fde7a
1 changed files with 19 additions and 2 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue