diff --git a/src/Framework/MockObject/Generator/templates/doubled_method.tpl b/src/Framework/MockObject/Generator/templates/doubled_method.tpl index 42c8923e2b2..8ecd412c213 100644 --- a/src/Framework/MockObject/Generator/templates/doubled_method.tpl +++ b/src/Framework/MockObject/Generator/templates/doubled_method.tpl @@ -1,18 +1,19 @@ {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} {{deprecation} - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [{arguments_call}]; $__phpunit_count = func_num_args(); @@ -23,7 +24,8 @@ $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/src/Framework/MockObject/Generator/templates/proxied_method.tpl b/src/Framework/MockObject/Generator/templates/proxied_method.tpl index 8c34967ef71..94db4665e83 100644 --- a/src/Framework/MockObject/Generator/templates/proxied_method.tpl +++ b/src/Framework/MockObject/Generator/templates/proxied_method.tpl @@ -1,18 +1,19 @@ {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [{arguments_call}]; $__phpunit_count = func_num_args(); @@ -23,7 +24,8 @@ $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/232.phpt b/tests/end-to-end/mock-objects/generator/232.phpt index 6b64d559f7f..983f6af2896 100644 --- a/tests/end-to-end/mock-objects/generator/232.phpt +++ b/tests/end-to-end/mock-objects/generator/232.phpt @@ -64,18 +64,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function speak() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -86,7 +87,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt b/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt index 22f28237e8f..7feda6cbb6c 100644 --- a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt +++ b/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt @@ -49,18 +49,19 @@ class Issue3154Mock extends Is\Namespaced\Issue3154 implements PHPUnit\Framework public function a(int $i = %d, int $j = 17, string $v = '%s', string $z = '#'): string { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$i, $j, $v, $z]; $__phpunit_count = func_num_args(); @@ -71,7 +72,8 @@ class Issue3154Mock extends Is\Namespaced\Issue3154 implements PHPUnit\Framework $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/3967.phpt b/tests/end-to-end/mock-objects/generator/3967.phpt index f064c8225e9..c037c6af695 100644 --- a/tests/end-to-end/mock-objects/generator/3967.phpt +++ b/tests/end-to-end/mock-objects/generator/3967.phpt @@ -37,18 +37,19 @@ class MockBaz extends Exception implements Baz, PHPUnit\Framework\MockObject\Moc public function foo(): string { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -59,7 +60,8 @@ class MockBaz extends Exception implements Baz, PHPUnit\Framework\MockObject\Moc $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/397.phpt b/tests/end-to-end/mock-objects/generator/397.phpt index 4de2d1e8b94..df096d4d4fa 100644 --- a/tests/end-to-end/mock-objects/generator/397.phpt +++ b/tests/end-to-end/mock-objects/generator/397.phpt @@ -35,18 +35,19 @@ class MockC extends C implements PHPUnit\Framework\MockObject\MockObjectInternal public function m(?C $other): C { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$other]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockC extends C implements PHPUnit\Framework\MockObject\MockObjectInternal $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/4139.phpt b/tests/end-to-end/mock-objects/generator/4139.phpt index 6ec4f8fc445..535c0f9e27f 100644 --- a/tests/end-to-end/mock-objects/generator/4139.phpt +++ b/tests/end-to-end/mock-objects/generator/4139.phpt @@ -25,18 +25,19 @@ class %s implements PHPUnit\Framework\MockObject\MockObjectInternal, InterfaceWi public function __construct() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -47,7 +48,8 @@ class %s implements PHPUnit\Framework\MockObject\MockObjectInternal, InterfaceWi $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/abstract_class.phpt b/tests/end-to-end/mock-objects/generator/abstract_class.phpt index 8d22b327c45..15261323796 100644 --- a/tests/end-to-end/mock-objects/generator/abstract_class.phpt +++ b/tests/end-to-end/mock-objects/generator/abstract_class.phpt @@ -39,18 +39,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function one() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -61,7 +62,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -74,18 +76,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function two() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -96,7 +99,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -109,18 +113,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte protected function three() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -131,7 +136,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class.phpt b/tests/end-to-end/mock-objects/generator/class.phpt index 92a0f76adec..69c70e064bb 100644 --- a/tests/end-to-end/mock-objects/generator/class.phpt +++ b/tests/end-to-end/mock-objects/generator/class.phpt @@ -39,18 +39,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -61,7 +62,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -74,18 +76,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function baz(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -96,7 +99,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt b/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt index e0c0c2069ed..055a815be0a 100644 --- a/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt +++ b/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_partial.phpt b/tests/end-to-end/mock-objects/generator/class_partial.phpt index 8ee41913d20..2eb741eb475 100644 --- a/tests/end-to-end/mock-objects/generator/class_partial.phpt +++ b/tests/end-to-end/mock-objects/generator/class_partial.phpt @@ -39,18 +39,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -61,7 +62,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt b/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt index be828fc8cf4..95fdd2fe646 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt @@ -41,18 +41,19 @@ class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\Moc { @trigger_error('The ClassWithDeprecatedMethod::deprecatedMethod method is deprecated (this method is deprecated).', E_USER_DEPRECATED); - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -63,7 +64,8 @@ class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\Moc $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt index 4e0ee87a569..1a0a23ce333 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt @@ -34,18 +34,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function method() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -56,7 +57,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt index 7d3b9a19e46..ce64bb2b7cc 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt @@ -35,18 +35,19 @@ class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments imp public function methodWithNullableTypehintedVariadicArguments($a, ?string ...$parameters) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$a]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments imp $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt index 3196fea05dd..b7100796a9e 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt @@ -35,18 +35,19 @@ class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements public function methodWithTypehintedVariadicArguments($a, string ...$parameters) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$a]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt index eee051441c2..ea1e2ec59c6 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt @@ -35,18 +35,19 @@ class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Fr public function methodWithVariadicArguments($a, ...$parameters) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$a]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Fr $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt b/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt index 10f8635cbf6..9c855906818 100644 --- a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt +++ b/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(int $baz = %d) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/interface.phpt b/tests/end-to-end/mock-objects/generator/interface.phpt index 68a85f26d41..2258c32cbb4 100644 --- a/tests/end-to-end/mock-objects/generator/interface.phpt +++ b/tests/end-to-end/mock-objects/generator/interface.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt b/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt index 83ebc6e58b0..8592925d272 100644 --- a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt +++ b/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt @@ -40,18 +40,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -62,7 +63,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -75,18 +77,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function baz(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -97,7 +100,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class.phpt index 2f88df16677..d6822a08dab 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class.phpt @@ -41,18 +41,19 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI public function bar(NS\Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -63,7 +64,8 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -76,18 +78,19 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI public function baz(NS\Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -98,7 +101,8 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt index 9ba4b578fee..5b111eacd43 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt @@ -41,18 +41,19 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI public function bar(NS\Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -63,7 +64,8 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObjectI $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt b/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt index 0a423be2041..36ae50392ff 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt @@ -35,18 +35,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, NS\Foo public function bar(NS\Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, NS\Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/nullable_types.phpt b/tests/end-to-end/mock-objects/generator/nullable_types.phpt index 78150822079..337d98cd0bb 100644 --- a/tests/end-to-end/mock-objects/generator/nullable_types.phpt +++ b/tests/end-to-end/mock-objects/generator/nullable_types.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(?int $x) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$x]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/nullable_union_type_parameter.phpt b/tests/end-to-end/mock-objects/generator/nullable_union_type_parameter.phpt index 3506652aad6..215e4872ea2 100644 --- a/tests/end-to-end/mock-objects/generator/nullable_union_type_parameter.phpt +++ b/tests/end-to-end/mock-objects/generator/nullable_union_type_parameter.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(bool|int $baz, Foo|null|stdClass $other) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz, $other]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/nullable_union_type_return.phpt b/tests/end-to-end/mock-objects/generator/nullable_union_type_return.phpt index dbb18d360d4..b8951419f06 100644 --- a/tests/end-to-end/mock-objects/generator/nullable_union_type_return.phpt +++ b/tests/end-to-end/mock-objects/generator/nullable_union_type_return.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(): bool|int|null { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_dnf.phpt b/tests/end-to-end/mock-objects/generator/parameter_dnf.phpt index 16e195ea38c..ff461b3b6d9 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_dnf.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_dnf.phpt @@ -48,18 +48,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar((A&B)|int|null $baz) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -70,7 +71,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_false.phpt b/tests/end-to-end/mock-objects/generator/parameter_false.phpt index 283d24c2002..8918a0e0bc3 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_false.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_false.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(false $baz): void { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_intersection.phpt b/tests/end-to-end/mock-objects/generator/parameter_intersection.phpt index 3a0ee2c0f3c..fd71afe49b0 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_intersection.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_intersection.phpt @@ -43,18 +43,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(AnInterface&AnotherInterface $baz) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -65,7 +66,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_null.phpt b/tests/end-to-end/mock-objects/generator/parameter_null.phpt index 64a8ad6b06f..2798d272833 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_null.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_null.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(null $baz): void { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_true.phpt b/tests/end-to-end/mock-objects/generator/parameter_true.phpt index 06432c0e8c7..9f887d660b8 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_true.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_true.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(true $baz): void { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/parameter_union.phpt b/tests/end-to-end/mock-objects/generator/parameter_union.phpt index d9e6003c256..44528fca51e 100644 --- a/tests/end-to-end/mock-objects/generator/parameter_union.phpt +++ b/tests/end-to-end/mock-objects/generator/parameter_union.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(bool|int $baz, Foo|stdClass $other) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz, $other]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/proxy.phpt b/tests/end-to-end/mock-objects/generator/proxy.phpt index c9d1f364e55..8e6453fc46b 100644 --- a/tests/end-to-end/mock-objects/generator/proxy.phpt +++ b/tests/end-to-end/mock-objects/generator/proxy.phpt @@ -34,18 +34,19 @@ class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInt public function bar(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -56,7 +57,8 @@ class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInt $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -71,18 +73,19 @@ class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInt public function baz(Foo $foo) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -93,7 +96,8 @@ class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInt $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt index d911701220e..8c563f8a0a0 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(): Closure { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_dnf.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_dnf.phpt index afbc20bc906..8f7b39600bf 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_dnf.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_dnf.phpt @@ -48,18 +48,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(): (A&B)|int|null { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -70,7 +71,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_false.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_false.phpt index 3691a4d085d..1cff137cb95 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_false.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_false.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(): false { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt index e35ecbd5f94..a44f218db5c 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt @@ -40,18 +40,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(): FinalClass { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -62,7 +63,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt index f6f855fb089..bba83cc3e66 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(): Generator { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_intersection.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_intersection.phpt index 96b91c4497d..83353f44a16 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_intersection.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_intersection.phpt @@ -43,18 +43,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(): AnInterface&AnotherInterface { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -65,7 +66,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_never.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_never.phpt index 7bb8579d312..00fadb261c2 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_never.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_never.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(string $baz): never { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_null.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_null.phpt index 9265bfcedb5..e5bf4557ae6 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_null.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_null.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(): null { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt index d6689416538..50e7729e74d 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(string $baz): ?string { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt index bd90dcc3a1c..0624a88db1c 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt @@ -36,18 +36,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(string $baz): Bar { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -58,7 +59,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt index 40ed09250f5..f781369dae9 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt @@ -40,18 +40,19 @@ class MockBar extends Bar implements PHPUnit\Framework\MockObject\MockObjectInte public function baz(): Foo { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -62,7 +63,8 @@ class MockBar extends Bar implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt index 44132d0e581..dada8dcb80a 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(string $baz): Foo { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_static.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_static.phpt index 4c457b73e2b..0aa1b619133 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_static.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_static.phpt @@ -43,18 +43,19 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen public function returnsStatic(): static { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -65,7 +66,8 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -78,18 +80,19 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen public function returnsStaticOrNull(): ?static { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -100,7 +103,8 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( @@ -113,18 +117,19 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen public function returnsUnionWithStatic(): static|stdClass { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -135,7 +140,8 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_true.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_true.phpt index 67103d0a23c..acb48690c9a 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_true.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_true.phpt @@ -38,18 +38,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(): true { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -60,7 +61,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_union.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_union.phpt index debf16bc794..8432acf3916 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_union.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_union.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(): bool|int { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt index 43eab3e53c6..c73556df98e 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt @@ -33,18 +33,19 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo public function bar(string $baz): void { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -55,7 +56,8 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObjectInternal, Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt b/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt index 8eea9061c87..b20b468594e 100644 --- a/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt +++ b/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt @@ -35,18 +35,19 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte public function bar(string $baz) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$baz]; $__phpunit_count = func_num_args(); @@ -57,7 +58,8 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObjectInte $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/call_original.phpt b/tests/end-to-end/mock-objects/mock-method/call_original.phpt index a10a2301165..4beb2faabfb 100644 --- a/tests/end-to-end/mock-objects/mock-method/call_original.phpt +++ b/tests/end-to-end/mock-objects/mock-method/call_original.phpt @@ -23,18 +23,19 @@ print $code; public function bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ print $code; $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/call_original_with_argument.phpt b/tests/end-to-end/mock-objects/mock-method/call_original_with_argument.phpt index f094e0b1150..8dfab7f39ae 100644 --- a/tests/end-to-end/mock-objects/mock-method/call_original_with_argument.phpt +++ b/tests/end-to-end/mock-objects/mock-method/call_original_with_argument.phpt @@ -23,18 +23,19 @@ print $code; private function bar($arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar($arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/call_original_with_argument_variadic.phpt b/tests/end-to-end/mock-objects/mock-method/call_original_with_argument_variadic.phpt index 68b8c418b88..bf99664c952 100644 --- a/tests/end-to-end/mock-objects/mock-method/call_original_with_argument_variadic.phpt +++ b/tests/end-to-end/mock-objects/mock-method/call_original_with_argument_variadic.phpt @@ -23,18 +23,19 @@ print $code; private function bar(...$args) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(...$args) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/call_original_with_return_type_void.phpt b/tests/end-to-end/mock-objects/mock-method/call_original_with_return_type_void.phpt index 2fd7c4ef8ed..f92156737e6 100644 --- a/tests/end-to-end/mock-objects/mock-method/call_original_with_return_type_void.phpt +++ b/tests/end-to-end/mock-objects/mock-method/call_original_with_return_type_void.phpt @@ -23,18 +23,19 @@ print $code; public function bar(): void { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ print $code; $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/clone_method_arguments.phpt b/tests/end-to-end/mock-objects/mock-method/clone_method_arguments.phpt index e40fb0adb25..50ab1870d1e 100644 --- a/tests/end-to-end/mock-objects/mock-method/clone_method_arguments.phpt +++ b/tests/end-to-end/mock-objects/mock-method/clone_method_arguments.phpt @@ -23,18 +23,19 @@ print $code; public function bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ print $code; $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/deprecated_with_description.phpt b/tests/end-to-end/mock-objects/mock-method/deprecated_with_description.phpt index 439fabe3d7e..6ccdc32901b 100644 --- a/tests/end-to-end/mock-objects/mock-method/deprecated_with_description.phpt +++ b/tests/end-to-end/mock-objects/mock-method/deprecated_with_description.phpt @@ -28,18 +28,19 @@ public function bar() { @trigger_error('The Foo::bar method is deprecated (some explanation).', E_USER_DEPRECATED); - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -50,7 +51,8 @@ public function bar() $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/deprecated_without_description.phpt b/tests/end-to-end/mock-objects/mock-method/deprecated_without_description.phpt index 185c0b07f71..e2a387ecfe0 100644 --- a/tests/end-to-end/mock-objects/mock-method/deprecated_without_description.phpt +++ b/tests/end-to-end/mock-objects/mock-method/deprecated_without_description.phpt @@ -28,18 +28,19 @@ public function bar() { @trigger_error('The Foo::bar method is deprecated ().', E_USER_DEPRECATED); - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -50,7 +51,8 @@ public function bar() $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/private_method.phpt b/tests/end-to-end/mock-objects/mock-method/private_method.phpt index 7cdf9654974..f844e12da35 100644 --- a/tests/end-to-end/mock-objects/mock-method/private_method.phpt +++ b/tests/end-to-end/mock-objects/mock-method/private_method.phpt @@ -23,18 +23,19 @@ print $code; private function bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar() $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/protected_method.phpt b/tests/end-to-end/mock-objects/mock-method/protected_method.phpt index d7127d2e79a..f8f6d82999e 100644 --- a/tests/end-to-end/mock-objects/mock-method/protected_method.phpt +++ b/tests/end-to-end/mock-objects/mock-method/protected_method.phpt @@ -23,18 +23,19 @@ print $code; protected function bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ protected function bar() $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/return_by_reference.phpt b/tests/end-to-end/mock-objects/mock-method/return_by_reference.phpt index f0297d929cd..51156da0c97 100644 --- a/tests/end-to-end/mock-objects/mock-method/return_by_reference.phpt +++ b/tests/end-to-end/mock-objects/mock-method/return_by_reference.phpt @@ -23,18 +23,19 @@ print $code; public function &bar() { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ public function &bar() $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/return_by_reference_with_return_type.phpt b/tests/end-to-end/mock-objects/mock-method/return_by_reference_with_return_type.phpt index 9b2aa1d4503..3baa0687d02 100644 --- a/tests/end-to-end/mock-objects/mock-method/return_by_reference_with_return_type.phpt +++ b/tests/end-to-end/mock-objects/mock-method/return_by_reference_with_return_type.phpt @@ -23,18 +23,19 @@ print $code; public function &bar(): string { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ public function &bar(): string $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/return_type.phpt b/tests/end-to-end/mock-objects/mock-method/return_type.phpt index 29099770c92..9d44056ae7b 100644 --- a/tests/end-to-end/mock-objects/mock-method/return_type.phpt +++ b/tests/end-to-end/mock-objects/mock-method/return_type.phpt @@ -23,18 +23,19 @@ print $code; public function bar(): string { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ public function bar(): string $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/return_type_parent.phpt b/tests/end-to-end/mock-objects/mock-method/return_type_parent.phpt index 8e082a6b3a1..7fd0b2734a6 100644 --- a/tests/end-to-end/mock-objects/mock-method/return_type_parent.phpt +++ b/tests/end-to-end/mock-objects/mock-method/return_type_parent.phpt @@ -27,18 +27,19 @@ print $code; public function bar(): Baz { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -49,7 +50,8 @@ public function bar(): Baz $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/return_type_self.phpt b/tests/end-to-end/mock-objects/mock-method/return_type_self.phpt index 4dca3024da3..7ccd57a45ac 100644 --- a/tests/end-to-end/mock-objects/mock-method/return_type_self.phpt +++ b/tests/end-to-end/mock-objects/mock-method/return_type_self.phpt @@ -23,18 +23,19 @@ print $code; public function bar(): Foo { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ public function bar(): Foo $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument.phpt index eb5017e92c6..76b527ea4e4 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument.phpt @@ -23,18 +23,19 @@ print $code; private function bar($arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar($arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_default.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_default.phpt index cef0dcfb005..aaac640b99c 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_default.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_default.phpt @@ -23,18 +23,19 @@ print $code; private function bar($arg = false) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar($arg = false) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_default_constant.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_default_constant.phpt index 167ff5bde6c..e7d79d5330d 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_default_constant.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_default_constant.phpt @@ -28,18 +28,19 @@ print $code; private function bar($a = 1, $b = 2, $c = 3, $d = 4) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$a, $b, $c, $d]; $__phpunit_count = func_num_args(); @@ -50,7 +51,8 @@ private function bar($a = 1, $b = 2, $c = 3, $d = 4) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_default_new_expression.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_default_new_expression.phpt index fcf9a1d1d4f..94ef6dcfd99 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_default_new_expression.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_default_new_expression.phpt @@ -30,18 +30,19 @@ print $code; public function method(Foo $foo = new \Foo(1, 2, 3)) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$foo]; $__phpunit_count = func_num_args(); @@ -52,7 +53,8 @@ public function method(Foo $foo = new \Foo(1, 2, 3)) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_default_null.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_default_null.phpt index 634311eef3b..07fe364b31a 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_default_null.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_default_null.phpt @@ -23,18 +23,19 @@ print $code; private function bar($arg = NULL) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar($arg = NULL) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_nullable.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_nullable.phpt index 2918a0a3654..6a7b2d35a7e 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_nullable.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_nullable.phpt @@ -23,18 +23,19 @@ print $code; private function bar(?string $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(?string $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_reference.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_reference.phpt index 344b1f9a1c5..149dc6adfea 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_reference.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_reference.phpt @@ -23,18 +23,19 @@ print $code; private function bar(&$arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [&$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(&$arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_array.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_array.phpt index a44d3137df9..08f5391e64c 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_array.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_array.phpt @@ -23,18 +23,19 @@ print $code; private function bar(array $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(array $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_callable.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_callable.phpt index 1ccf0a321ad..d94e276f681 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_callable.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_callable.phpt @@ -23,18 +23,19 @@ print $code; private function bar(callable $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(callable $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_class.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_class.phpt index 5287cd9c60f..54375f6806b 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_class.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_class.phpt @@ -23,18 +23,19 @@ print $code; private function bar(Exception $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(Exception $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_scalar.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_scalar.phpt index 60eac9d980a..a59f3871d18 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_scalar.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_scalar.phpt @@ -23,18 +23,19 @@ print $code; private function bar(string $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(string $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_self.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_self.phpt index 4aee7811d94..4d7d5293807 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_self.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_self.phpt @@ -23,18 +23,19 @@ print $code; private function bar(Foo $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(Foo $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_unkown_class.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_unkown_class.phpt index 10922d89cf9..a0549f5ef08 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_unkown_class.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_unkown_class.phpt @@ -23,18 +23,19 @@ print $code; private function bar(UnknownClass $arg) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(UnknownClass $arg) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_variadic.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_variadic.phpt index 61ff4b79b94..3c2a792c356 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_typed_variadic.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_typed_variadic.phpt @@ -23,18 +23,19 @@ print $code; private function bar(string ...$args) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(string ...$args) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_argument_variadic.phpt b/tests/end-to-end/mock-objects/mock-method/with_argument_variadic.phpt index 06cdec261bf..e4ce178d801 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_argument_variadic.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_argument_variadic.phpt @@ -23,18 +23,19 @@ print $code; private function bar(...$args) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = []; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar(...$args) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation( diff --git a/tests/end-to-end/mock-objects/mock-method/with_arguments.phpt b/tests/end-to-end/mock-objects/mock-method/with_arguments.phpt index 4058b2f270b..7cdbfa7adb7 100644 --- a/tests/end-to-end/mock-objects/mock-method/with_arguments.phpt +++ b/tests/end-to-end/mock-objects/mock-method/with_arguments.phpt @@ -23,18 +23,19 @@ print $code; private function bar($arg1, $arg2) { - $definedVariables = get_defined_vars(); - $namedVariadicParameters = []; - foreach ($definedVariables as $name => $value) { - $reflectionParam = new ReflectionParameter([__CLASS__, __FUNCTION__], $name); - if ($reflectionParam->isVariadic()) { - foreach ($value as $key => $namedValue) { - if (is_string($key)) { - $namedVariadicParameters[$key] = $namedValue; + $__phpunit_definedVariables = get_defined_vars(); + $__phpunit_namedVariadicParameters = []; + + foreach ($__phpunit_definedVariables as $__phpunit_definedVariableName => $__phpunit_definedVariableValue) { + if ((new ReflectionParameter([__CLASS__, __FUNCTION__], $__phpunit_definedVariableName))->isVariadic()) { + foreach ($__phpunit_definedVariableValue as $__phpunit_key => $__phpunit_namedValue) { + if (is_string($__phpunit_key)) { + $__phpunit_namedVariadicParameters[$__phpunit_key] = $__phpunit_namedValue; } } } } + $__phpunit_arguments = [$arg1, $arg2]; $__phpunit_count = func_num_args(); @@ -45,7 +46,8 @@ private function bar($arg1, $arg2) $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; } } - $__phpunit_arguments = array_merge($__phpunit_arguments, $namedVariadicParameters); + + $__phpunit_arguments = array_merge($__phpunit_arguments, $__phpunit_namedVariadicParameters); $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( new \PHPUnit\Framework\MockObject\Invocation(