From a4294135a6fc78e69116d1a50b87235eb2d5fdd9 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 24 Mar 2022 09:00:05 +0100 Subject: [PATCH] Simplify #4938 for PHPUnit 10 where we do not need to care about PHP 7 --- ...utReturnType.php => MockedCloneMethod.php} | 2 +- .../MockedCloneMethodWithVoidReturnType.php | 21 ---- ...ReturnType.php => UnmockedCloneMethod.php} | 2 +- .../UnmockedCloneMethodWithVoidReturnType.php | 23 ---- src/Framework/MockObject/Generator.php | 12 +- .../mock-objects/generator/232-php7.phpt | 89 --------------- .../generator/{232-php8.phpt => 232.phpt} | 2 +- ...54_namespaced_constant_resolving-php7.phpt | 74 ------------ ...> 3154_namespaced_constant_resolving.phpt} | 2 +- .../mock-objects/generator/3967.phpt | 2 +- .../mock-objects/generator/397-php7.phpt | 60 ---------- .../generator/{397-php8.phpt => 397.phpt} | 2 +- .../mock-objects/generator/4139-php7.phpt | 51 --------- .../generator/{4139-php8.phpt => 4139.phpt} | 2 +- .../generator/abstract_class-php7.phpt | 108 ------------------ ...ct_class-php8.phpt => abstract_class.phpt} | 2 +- .../mock-objects/generator/class-php7.phpt | 86 -------------- .../generator/{class-php8.phpt => class.phpt} | 2 +- .../class_call_parent_clone-php7.phpt | 37 ------ ...php8.phpt => class_call_parent_clone.phpt} | 2 +- .../class_call_parent_constructor-php7.phpt | 37 ------ ...hpt => class_call_parent_constructor.phpt} | 2 +- .../class_dont_call_parent_clone-php7.phpt | 37 ------ ...phpt => class_dont_call_parent_clone.phpt} | 2 +- ...ass_dont_call_parent_constructor-php7.phpt | 37 ------ ...> class_dont_call_parent_constructor.phpt} | 2 +- ...nterface_call_parent_constructor-php7.phpt | 42 ------- ...ng_interface_call_parent_constructor.phpt} | 2 +- ...ace_dont_call_parent_constructor-php7.phpt | 42 ------- ...terface_dont_call_parent_constructor.phpt} | 2 +- .../class_nonexistent_method-php7.phpt | 60 ---------- ...hp8.phpt => class_nonexistent_method.phpt} | 2 +- .../generator/class_partial-php7.phpt | 64 ----------- ...s_partial-php8.phpt => class_partial.phpt} | 2 +- .../class_with_deprecated_method-php7.phpt | 66 ----------- ...phpt => class_with_deprecated_method.phpt} | 2 +- .../class_with_final_method-php7.phpt | 38 ------ ...php8.phpt => class_with_final_method.phpt} | 2 +- .../class_with_method_named_method-php7.phpt | 59 ---------- ...pt => class_with_method_named_method.phpt} | 2 +- ...le_typehinted_variadic_arguments-php7.phpt | 60 ---------- ...llable_typehinted_variadic_arguments.phpt} | 2 +- ...th_typehinted_variadic_arguments-php7.phpt | 60 ---------- ...d_with_typehinted_variadic_arguments.phpt} | 2 +- ...h_method_with_variadic_arguments-php7.phpt | 60 ---------- ..._with_method_with_variadic_arguments.phpt} | 2 +- ...stant_as_parameter_default_value-php7.phpt | 60 ---------- ... constant_as_parameter_default_value.phpt} | 2 +- .../generator/interface-php7.phpt | 58 ---------- .../{interface-php8.phpt => interface.phpt} | 2 +- .../intersection_type_parameter.phpt | 2 +- .../generator/intersection_type_return.phpt | 2 +- .../invocation_object_clone_object-php7.phpt | 87 -------------- ...pt => invocation_object_clone_object.phpt} | 2 +- .../generator/namespaced_class-php7.phpt | 88 -------------- ..._class-php8.phpt => namespaced_class.phpt} | 2 +- ...mespaced_class_call_parent_clone-php7.phpt | 39 ------- ...> namespaced_class_call_parent_clone.phpt} | 2 +- ...ed_class_call_parent_constructor-php7.phpt | 39 ------- ...spaced_class_call_parent_constructor.phpt} | 2 +- ...ced_class_dont_call_parent_clone-php7.phpt | 39 ------- ...espaced_class_dont_call_parent_clone.phpt} | 2 +- ...ass_dont_call_parent_constructor-php7.phpt | 39 ------- ...d_class_dont_call_parent_constructor.phpt} | 2 +- ...nterface_call_parent_constructor-php7.phpt | 44 ------- ...ng_interface_call_parent_constructor.phpt} | 2 +- ...ace_dont_call_parent_constructor-php7.phpt | 44 ------- ...terface_dont_call_parent_constructor.phpt} | 2 +- .../namespaced_class_partial-php7.phpt | 66 ----------- ...hp8.phpt => namespaced_class_partial.phpt} | 2 +- .../generator/namespaced_interface-php7.phpt | 60 ---------- ...ce-php8.phpt => namespaced_interface.phpt} | 2 +- .../generator/nonexistent_class-php7.phpt | 35 ------ ...class-php8.phpt => nonexistent_class.phpt} | 2 +- ...nonexistent_class_with_namespace-php7.phpt | 43 ------- ... => nonexistent_class_with_namespace.phpt} | 2 +- ...amespace_starting_with_separator-php7.phpt | 43 ------- ...th_namespace_starting_with_separator.phpt} | 2 +- .../generator/nullable_types-php7.phpt | 60 ---------- ...le_types-php8.phpt => nullable_types.phpt} | 2 +- .../nullable_union_type_parameter.phpt | 2 +- .../generator/nullable_union_type_return.phpt | 2 +- .../mock-objects/generator/proxy-php7.phpt | 82 ------------- .../generator/{proxy-php8.phpt => proxy.phpt} | 2 +- ...return_type_declarations_closure-php7.phpt | 58 ---------- ... => return_type_declarations_closure.phpt} | 2 +- .../return_type_declarations_final-php7.phpt | 65 ----------- ...pt => return_type_declarations_final.phpt} | 2 +- ...turn_type_declarations_generator-php7.phpt | 58 ---------- ...> return_type_declarations_generator.phpt} | 2 +- .../return_type_declarations_never.phpt | 2 +- ...eturn_type_declarations_nullable-php7.phpt | 58 ---------- ...=> return_type_declarations_nullable.phpt} | 2 +- ..._type_declarations_object_method-php7.phpt | 61 ---------- ...turn_type_declarations_object_method.phpt} | 2 +- .../return_type_declarations_parent-php7.phpt | 65 ----------- ...t => return_type_declarations_parent.phpt} | 2 +- .../return_type_declarations_self-php7.phpt | 58 ---------- ...hpt => return_type_declarations_self.phpt} | 2 +- .../return_type_declarations_static.phpt | 2 +- ..._type_declarations_static_method-php7.phpt | 44 ------- ...turn_type_declarations_static_method.phpt} | 2 +- .../return_type_declarations_void-php7.phpt | 56 --------- ...hpt => return_type_declarations_void.phpt} | 2 +- .../scalar_type_declarations-php7.phpt | 60 ---------- ...hp8.phpt => scalar_type_declarations.phpt} | 2 +- .../generator/union_type_parameter.phpt | 2 +- .../generator/union_type_return.phpt | 2 +- 108 files changed, 60 insertions(+), 2788 deletions(-) rename src/Framework/MockObject/Api/{MockedCloneMethodWithoutReturnType.php => MockedCloneMethod.php} (92%) delete mode 100644 src/Framework/MockObject/Api/MockedCloneMethodWithVoidReturnType.php rename src/Framework/MockObject/Api/{UnmockedCloneMethodWithoutReturnType.php => UnmockedCloneMethod.php} (92%) delete mode 100644 src/Framework/MockObject/Api/UnmockedCloneMethodWithVoidReturnType.php delete mode 100644 tests/end-to-end/mock-objects/generator/232-php7.phpt rename tests/end-to-end/mock-objects/generator/{232-php8.phpt => 232.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php7.phpt rename tests/end-to-end/mock-objects/generator/{3154_namespaced_constant_resolving-php8.phpt => 3154_namespaced_constant_resolving.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/397-php7.phpt rename tests/end-to-end/mock-objects/generator/{397-php8.phpt => 397.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/4139-php7.phpt rename tests/end-to-end/mock-objects/generator/{4139-php8.phpt => 4139.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/abstract_class-php7.phpt rename tests/end-to-end/mock-objects/generator/{abstract_class-php8.phpt => abstract_class.phpt} (97%) delete mode 100644 tests/end-to-end/mock-objects/generator/class-php7.phpt rename tests/end-to-end/mock-objects/generator/{class-php8.phpt => class.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_call_parent_clone-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_call_parent_clone-php8.phpt => class_call_parent_clone.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_call_parent_constructor-php8.phpt => class_call_parent_constructor.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_dont_call_parent_clone-php8.phpt => class_dont_call_parent_clone.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_dont_call_parent_constructor-php8.phpt => class_dont_call_parent_constructor.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_implementing_interface_call_parent_constructor-php8.phpt => class_implementing_interface_call_parent_constructor.phpt} (91%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_implementing_interface_dont_call_parent_constructor-php8.phpt => class_implementing_interface_dont_call_parent_constructor.phpt} (91%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_nonexistent_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_nonexistent_method-php8.phpt => class_nonexistent_method.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_partial-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_partial-php8.phpt => class_partial.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_deprecated_method-php8.phpt => class_with_deprecated_method.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_final_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_final_method-php8.phpt => class_with_final_method.phpt} (91%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_method_named_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_method_named_method-php8.phpt => class_with_method_named_method.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_method_with_nullable_typehinted_variadic_arguments-php8.phpt => class_with_method_with_nullable_typehinted_variadic_arguments.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_method_with_typehinted_variadic_arguments-php8.phpt => class_with_method_with_typehinted_variadic_arguments.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php7.phpt rename tests/end-to-end/mock-objects/generator/{class_with_method_with_variadic_arguments-php8.phpt => class_with_method_with_variadic_arguments.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php7.phpt rename tests/end-to-end/mock-objects/generator/{constant_as_parameter_default_value-php8.phpt => constant_as_parameter_default_value.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/interface-php7.phpt rename tests/end-to-end/mock-objects/generator/{interface-php8.phpt => interface.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php7.phpt rename tests/end-to-end/mock-objects/generator/{invocation_object_clone_object-php8.phpt => invocation_object_clone_object.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class-php8.phpt => namespaced_class.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_call_parent_clone-php8.phpt => namespaced_class_call_parent_clone.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_dont_call_parent_constructor-php8.phpt => namespaced_class_call_parent_constructor.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_dont_call_parent_clone-php8.phpt => namespaced_class_dont_call_parent_clone.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_call_parent_constructor-php8.phpt => namespaced_class_dont_call_parent_constructor.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_implementing_interface_call_parent_constructor-php8.phpt => namespaced_class_implementing_interface_call_parent_constructor.phpt} (91%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_implementing_interface_dont_call_parent_constructor-php8.phpt => namespaced_class_implementing_interface_dont_call_parent_constructor.phpt} (91%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_class_partial-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_class_partial-php8.phpt => namespaced_class_partial.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/namespaced_interface-php7.phpt rename tests/end-to-end/mock-objects/generator/{namespaced_interface-php8.phpt => namespaced_interface.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/nonexistent_class-php7.phpt rename tests/end-to-end/mock-objects/generator/{nonexistent_class-php8.phpt => nonexistent_class.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php7.phpt rename tests/end-to-end/mock-objects/generator/{nonexistent_class_with_namespace-php8.phpt => nonexistent_class_with_namespace.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php7.phpt rename tests/end-to-end/mock-objects/generator/{nonexistent_class_with_namespace_starting_with_separator-php8.phpt => nonexistent_class_with_namespace_starting_with_separator.phpt} (90%) delete mode 100644 tests/end-to-end/mock-objects/generator/nullable_types-php7.phpt rename tests/end-to-end/mock-objects/generator/{nullable_types-php8.phpt => nullable_types.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/proxy-php7.phpt rename tests/end-to-end/mock-objects/generator/{proxy-php8.phpt => proxy.phpt} (96%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_closure-php8.phpt => return_type_declarations_closure.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_final-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_final-php8.phpt => return_type_declarations_final.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_generator-php8.phpt => return_type_declarations_generator.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_nullable-php8.phpt => return_type_declarations_nullable.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_object_method-php8.phpt => return_type_declarations_object_method.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_parent-php8.phpt => return_type_declarations_parent.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_self-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_self-php8.phpt => return_type_declarations_self.phpt} (95%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_static_method-php8.phpt => return_type_declarations_static_method.phpt} (92%) delete mode 100644 tests/end-to-end/mock-objects/generator/return_type_declarations_void-php7.phpt rename tests/end-to-end/mock-objects/generator/{return_type_declarations_void-php8.phpt => return_type_declarations_void.phpt} (94%) delete mode 100644 tests/end-to-end/mock-objects/generator/scalar_type_declarations-php7.phpt rename tests/end-to-end/mock-objects/generator/{scalar_type_declarations-php8.phpt => scalar_type_declarations.phpt} (95%) diff --git a/src/Framework/MockObject/Api/MockedCloneMethodWithoutReturnType.php b/src/Framework/MockObject/Api/MockedCloneMethod.php similarity index 92% rename from src/Framework/MockObject/Api/MockedCloneMethodWithoutReturnType.php rename to src/Framework/MockObject/Api/MockedCloneMethod.php index 9fbbc28692c..41e5b315862 100644 --- a/src/Framework/MockObject/Api/MockedCloneMethodWithoutReturnType.php +++ b/src/Framework/MockObject/Api/MockedCloneMethod.php @@ -12,7 +12,7 @@ /** * @internal This trait is not covered by the backward compatibility promise for PHPUnit */ -trait MockedCloneMethodWithoutReturnType +trait MockedCloneMethod { public function __clone(): void { diff --git a/src/Framework/MockObject/Api/MockedCloneMethodWithVoidReturnType.php b/src/Framework/MockObject/Api/MockedCloneMethodWithVoidReturnType.php deleted file mode 100644 index adbf82f3949..00000000000 --- a/src/Framework/MockObject/Api/MockedCloneMethodWithVoidReturnType.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait MockedCloneMethodWithVoidReturnType -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - } -} diff --git a/src/Framework/MockObject/Api/UnmockedCloneMethodWithoutReturnType.php b/src/Framework/MockObject/Api/UnmockedCloneMethod.php similarity index 92% rename from src/Framework/MockObject/Api/UnmockedCloneMethodWithoutReturnType.php rename to src/Framework/MockObject/Api/UnmockedCloneMethod.php index 6036c807ff5..9bca70005f7 100644 --- a/src/Framework/MockObject/Api/UnmockedCloneMethodWithoutReturnType.php +++ b/src/Framework/MockObject/Api/UnmockedCloneMethod.php @@ -12,7 +12,7 @@ /** * @internal This trait is not covered by the backward compatibility promise for PHPUnit */ -trait UnmockedCloneMethodWithoutReturnType +trait UnmockedCloneMethod { public function __clone(): void { diff --git a/src/Framework/MockObject/Api/UnmockedCloneMethodWithVoidReturnType.php b/src/Framework/MockObject/Api/UnmockedCloneMethodWithVoidReturnType.php deleted file mode 100644 index af90e4fe9e9..00000000000 --- a/src/Framework/MockObject/Api/UnmockedCloneMethodWithVoidReturnType.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait UnmockedCloneMethodWithVoidReturnType -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - - parent::__clone(); - } -} diff --git a/src/Framework/MockObject/Generator.php b/src/Framework/MockObject/Generator.php index 0a5ac773474..cc765c8463f 100644 --- a/src/Framework/MockObject/Generator.php +++ b/src/Framework/MockObject/Generator.php @@ -882,19 +882,11 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc $cloneTrait = ''; if ($mockedCloneMethod) { - if (PHP_MAJOR_VERSION >= 8) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType;'; - } else { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType;'; - } + $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethod;'; } if ($unmockedCloneMethod) { - if (PHP_MAJOR_VERSION >= 8) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType;'; - } else { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithoutReturnType;'; - } + $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethod;'; } $classTemplate->setVar( diff --git a/tests/end-to-end/mock-objects/generator/232-php7.phpt b/tests/end-to-end/mock-objects/generator/232-php7.phpt deleted file mode 100644 index 05df467fbdc..00000000000 --- a/tests/end-to-end/mock-objects/generator/232-php7.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -hi(); - } -} - -class Foo -{ - use ChildTrait; - - public function speak() - { - return $this->world(); - } -} - -require_once __DIR__ . '/../../../bootstrap.php'; - -$generator = new \PHPUnit\Framework\MockObject\Generator; - -$mock = $generator->generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function speak() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'speak', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/232-php8.phpt b/tests/end-to-end/mock-objects/generator/232.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/232-php8.phpt rename to tests/end-to-end/mock-objects/generator/232.phpt index a2adfdea4c8..f627155d4b0 100644 --- a/tests/end-to-end/mock-objects/generator/232-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/232.phpt @@ -63,7 +63,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function speak() { diff --git a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php7.phpt b/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php7.phpt deleted file mode 100644 index 0936fe6f29a..00000000000 --- a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php7.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -https://github.com/sebastianbergmann/phpunit-mock-objects/issues/420 -https://github.com/sebastianbergmann/phpunit/issues/3154 ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -const A_CONSTANT = 17; -const PHP_VERSION = ""; - -class Issue3154 -{ - public function a(int $i = PHP_INT_MAX, int $j = A_CONSTANT, string $v = \PHP_VERSION, string $z = '#'): string - { - return $z."sum: ".($i+$j).$v; - } -} -require_once __DIR__ . '/../../../bootstrap.php'; - -$generator = new \PHPUnit\Framework\MockObject\Generator; - -$mock = $generator->generate( - Issue3154::class, - [], - 'Issue3154Mock', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class Issue3154Mock extends Is\Namespaced\Issue3154 implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function a(int $i = %d, int $j = 17, string $v = '%s', string $z = '#'): string - { - $__phpunit_arguments = [$i, $j, $v, $z]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 4) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 4; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Is\Namespaced\Issue3154', 'a', $__phpunit_arguments, 'string', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php8.phpt b/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php8.phpt rename to tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt index 4165e6d361b..2a78a11b7e7 100644 --- a/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/3154_namespaced_constant_resolving.phpt @@ -48,7 +48,7 @@ class Issue3154Mock extends Is\Namespaced\Issue3154 implements PHPUnit\Framework { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function a(int $i = %d, int $j = 17, string $v = '%s', string $z = '#'): string { diff --git a/tests/end-to-end/mock-objects/generator/3967.phpt b/tests/end-to-end/mock-objects/generator/3967.phpt index db6deffc26a..59a5a2a2b0c 100644 --- a/tests/end-to-end/mock-objects/generator/3967.phpt +++ b/tests/end-to-end/mock-objects/generator/3967.phpt @@ -36,7 +36,7 @@ class MockBaz extends Exception implements Baz, PHPUnit\Framework\MockObject\Moc { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\UnmockedCloneMethod; public function foo(): string { diff --git a/tests/end-to-end/mock-objects/generator/397-php7.phpt b/tests/end-to-end/mock-objects/generator/397-php7.phpt deleted file mode 100644 index 166d77b2637..00000000000 --- a/tests/end-to-end/mock-objects/generator/397-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -https://github.com/sebastianbergmann/phpunit-mock-objects/issues/397 ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - C::class, - [], - 'MockC', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockC extends C implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function m(?C $other): C - { - $__phpunit_arguments = [$other]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'C', 'm', $__phpunit_arguments, 'C', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/397-php8.phpt b/tests/end-to-end/mock-objects/generator/397.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/397-php8.phpt rename to tests/end-to-end/mock-objects/generator/397.phpt index 94fc3a1c224..a31076475e5 100644 --- a/tests/end-to-end/mock-objects/generator/397-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/397.phpt @@ -34,7 +34,7 @@ class MockC extends C implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function m(?C $other): C { diff --git a/tests/end-to-end/mock-objects/generator/4139-php7.phpt b/tests/end-to-end/mock-objects/generator/4139-php7.phpt deleted file mode 100644 index 3d35966fd42..00000000000 --- a/tests/end-to-end/mock-objects/generator/4139-php7.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -https://github.com/sebastianbergmann/phpunit/issues/4139 ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate(InterfaceWithConstructor::class); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class %s implements PHPUnit\Framework\MockObject\MockObject, InterfaceWithConstructor -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function __construct() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'InterfaceWithConstructor', '__construct', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/4139-php8.phpt b/tests/end-to-end/mock-objects/generator/4139.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/4139-php8.phpt rename to tests/end-to-end/mock-objects/generator/4139.phpt index ee3835d858c..574f5bb22ce 100644 --- a/tests/end-to-end/mock-objects/generator/4139-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/4139.phpt @@ -25,7 +25,7 @@ class %s implements PHPUnit\Framework\MockObject\MockObject, InterfaceWithConstr { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function __construct() { diff --git a/tests/end-to-end/mock-objects/generator/abstract_class-php7.phpt b/tests/end-to-end/mock-objects/generator/abstract_class-php7.phpt deleted file mode 100644 index fda1d0debc9..00000000000 --- a/tests/end-to-end/mock-objects/generator/abstract_class-php7.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function one() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'one', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } - - public function two() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'two', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } - - protected function three() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'three', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/abstract_class-php8.phpt b/tests/end-to-end/mock-objects/generator/abstract_class.phpt similarity index 97% rename from tests/end-to-end/mock-objects/generator/abstract_class-php8.phpt rename to tests/end-to-end/mock-objects/generator/abstract_class.phpt index f6bc190b31e..d28f8683fc8 100644 --- a/tests/end-to-end/mock-objects/generator/abstract_class-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/abstract_class.phpt @@ -38,7 +38,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function one() { diff --git a/tests/end-to-end/mock-objects/generator/class-php7.phpt b/tests/end-to-end/mock-objects/generator/class-php7.phpt deleted file mode 100644 index 1e4f9ff8cf3..00000000000 --- a/tests/end-to-end/mock-objects/generator/class-php7.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } - - public function baz(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'baz', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class-php8.phpt b/tests/end-to-end/mock-objects/generator/class.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/class-php8.phpt rename to tests/end-to-end/mock-objects/generator/class.phpt index 8b2f704e21e..4e38859ca21 100644 --- a/tests/end-to-end/mock-objects/generator/class-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class.phpt @@ -38,7 +38,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/class_call_parent_clone-php7.phpt b/tests/end-to-end/mock-objects/generator/class_call_parent_clone-php7.phpt deleted file mode 100644 index 0512614797e..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_call_parent_clone-php7.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_call_parent_clone-php8.phpt b/tests/end-to-end/mock-objects/generator/class_call_parent_clone.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/class_call_parent_clone-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_call_parent_clone.phpt index 3fbf1c0e104..5c6211ed158 100644 --- a/tests/end-to-end/mock-objects/generator/class_call_parent_clone-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_call_parent_clone.phpt @@ -33,5 +33,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\UnmockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php7.phpt deleted file mode 100644 index d50b555317c..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/class_call_parent_constructor.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_call_parent_constructor.phpt index 43808b1633f..084584b1a7d 100644 --- a/tests/end-to-end/mock-objects/generator/class_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_call_parent_constructor.phpt @@ -33,5 +33,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php7.phpt b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php7.phpt deleted file mode 100644 index d4a200fc559..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php7.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', false) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - false -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php8.phpt b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone.phpt index c00986d021e..85bfb4e3a32 100644 --- a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_clone.phpt @@ -33,5 +33,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php7.phpt deleted file mode 100644 index d50b555317c..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor.phpt index 43808b1633f..084584b1a7d 100644 --- a/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_dont_call_parent_constructor.phpt @@ -33,5 +33,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php7.phpt deleted file mode 100644 index a9efc67ae94..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor.phpt similarity index 91% rename from tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor.phpt index 59ec530a8be..086fd4568a4 100644 --- a/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_implementing_interface_call_parent_constructor.phpt @@ -38,5 +38,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php7.phpt deleted file mode 100644 index a9efc67ae94..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor.phpt similarity index 91% rename from tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor.phpt index 59ec530a8be..086fd4568a4 100644 --- a/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_implementing_interface_dont_call_parent_constructor.phpt @@ -38,5 +38,5 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_nonexistent_method-php7.phpt b/tests/end-to-end/mock-objects/generator/class_nonexistent_method-php7.phpt deleted file mode 100644 index 4882e6f1fd7..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_nonexistent_method-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', array('bar'), 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - array('bar'), - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_nonexistent_method-php8.phpt b/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/class_nonexistent_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt index 7c7ed6d6d39..fa915c06f84 100644 --- a/tests/end-to-end/mock-objects/generator/class_nonexistent_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_nonexistent_method.phpt @@ -34,7 +34,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar() { diff --git a/tests/end-to-end/mock-objects/generator/class_partial-php7.phpt b/tests/end-to-end/mock-objects/generator/class_partial-php7.phpt deleted file mode 100644 index c9478111fd5..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_partial-php7.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', array('bar'), 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - array('bar'), - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_partial-php8.phpt b/tests/end-to-end/mock-objects/generator/class_partial.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/class_partial-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_partial.phpt index 7354640ec10..6ac1ad18d65 100644 --- a/tests/end-to-end/mock-objects/generator/class_partial-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_partial.phpt @@ -38,7 +38,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php7.phpt deleted file mode 100644 index 49937410a97..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php7.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('ClassWithDeprecatedMethod', [], 'MockFoo', TRUE, TRUE) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'ClassWithDeprecatedMethod', - [], - 'MockFoo', - TRUE, - TRUE -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function deprecatedMethod() - { - @trigger_error('The ClassWithDeprecatedMethod::deprecatedMethod method is deprecated (this method is deprecated).', E_USER_DEPRECATED); - - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'ClassWithDeprecatedMethod', 'deprecatedMethod', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt index c2af5773da7..ccbf2012aa9 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_deprecated_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_deprecated_method.phpt @@ -38,7 +38,7 @@ class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\Moc { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function deprecatedMethod() { diff --git a/tests/end-to-end/mock-objects/generator/class_with_final_method-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_final_method-php7.phpt deleted file mode 100644 index de19b88e95d..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_final_method-php7.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('ClassWithFinalMethod', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'ClassWithFinalMethod', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends ClassWithFinalMethod implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_final_method-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_final_method.phpt similarity index 91% rename from tests/end-to-end/mock-objects/generator/class_with_final_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_final_method.phpt index 6225c333011..99b3b2d1f15 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_final_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_final_method.phpt @@ -34,5 +34,5 @@ class MockFoo extends ClassWithFinalMethod implements PHPUnit\Framework\MockObje { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_named_method-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_named_method-php7.phpt deleted file mode 100644 index f3c2b5e5b1a..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_method_named_method-php7.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function method() - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'method', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_named_method-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/class_with_method_named_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt index 756a33f5666..ca77d2a3103 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_named_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_named_method.phpt @@ -33,7 +33,7 @@ declare(strict_types=1); class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function method() { diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php7.phpt deleted file mode 100644 index 2d7396750f0..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'ClassWithMethodWithNullableTypehintedVariadicArguments', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function methodWithNullableTypehintedVariadicArguments($a, ?string ...$parameters) - { - $__phpunit_arguments = [$a]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'ClassWithMethodWithNullableTypehintedVariadicArguments', 'methodWithNullableTypehintedVariadicArguments', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt index 6ead5ba0cc7..7aa1ffb2790 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt @@ -34,7 +34,7 @@ class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments imp { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function methodWithNullableTypehintedVariadicArguments($a, ?string ...$parameters) { diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php7.phpt deleted file mode 100644 index 606f23a5198..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'ClassWithMethodWithTypehintedVariadicArguments', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function methodWithTypehintedVariadicArguments($a, string ...$parameters) - { - $__phpunit_arguments = [$a]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'ClassWithMethodWithTypehintedVariadicArguments', 'methodWithTypehintedVariadicArguments', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt index 15e8e240854..4c23ad1a6c9 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_typehinted_variadic_arguments.phpt @@ -34,7 +34,7 @@ class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function methodWithTypehintedVariadicArguments($a, string ...$parameters) { diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php7.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php7.phpt deleted file mode 100644 index a3ed0f400c8..00000000000 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'ClassWithMethodWithVariadicArguments', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function methodWithVariadicArguments($a, ...$parameters) - { - $__phpunit_arguments = [$a]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'ClassWithMethodWithVariadicArguments', 'methodWithVariadicArguments', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php8.phpt b/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php8.phpt rename to tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt index 6f42f8bed5d..d164b682ad0 100644 --- a/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/class_with_method_with_variadic_arguments.phpt @@ -34,7 +34,7 @@ class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Fr { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function methodWithVariadicArguments($a, ...$parameters) { diff --git a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php7.phpt b/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php7.phpt deleted file mode 100644 index 86b152cc7b3..00000000000 --- a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(int $baz = %d) - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php8.phpt b/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php8.phpt rename to tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt index c1aa3e81998..74e911650c1 100644 --- a/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/constant_as_parameter_default_value.phpt @@ -34,7 +34,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(int $baz = %d) { diff --git a/tests/end-to-end/mock-objects/generator/interface-php7.phpt b/tests/end-to-end/mock-objects/generator/interface-php7.phpt deleted file mode 100644 index e73605dc675..00000000000 --- a/tests/end-to-end/mock-objects/generator/interface-php7.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/interface-php8.phpt b/tests/end-to-end/mock-objects/generator/interface.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/interface-php8.phpt rename to tests/end-to-end/mock-objects/generator/interface.phpt index 483e0a56022..e0f4a8d7d9f 100644 --- a/tests/end-to-end/mock-objects/generator/interface-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/interface.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/intersection_type_parameter.phpt b/tests/end-to-end/mock-objects/generator/intersection_type_parameter.phpt index 1cae2e045b1..b82be7d08d2 100644 --- a/tests/end-to-end/mock-objects/generator/intersection_type_parameter.phpt +++ b/tests/end-to-end/mock-objects/generator/intersection_type_parameter.phpt @@ -42,7 +42,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(AnInterface&AnotherInterface $baz) { diff --git a/tests/end-to-end/mock-objects/generator/intersection_type_return.phpt b/tests/end-to-end/mock-objects/generator/intersection_type_return.phpt index 76337aaf7cc..e3aec85fcb9 100644 --- a/tests/end-to-end/mock-objects/generator/intersection_type_return.phpt +++ b/tests/end-to-end/mock-objects/generator/intersection_type_return.phpt @@ -42,7 +42,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): AnInterface&AnotherInterface { diff --git a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php7.phpt b/tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php7.phpt deleted file mode 100644 index ea575a76ed4..00000000000 --- a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php7.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } - - public function baz(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'baz', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php8.phpt b/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php8.phpt rename to tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt index 2f47c89ba70..8893e3cdf83 100644 --- a/tests/end-to-end/mock-objects/generator/invocation_object_clone_object-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/invocation_object_clone_object.phpt @@ -39,7 +39,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class-php7.phpt deleted file mode 100644 index 964f0463285..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class-php7.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(NS\Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'NS\Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } - - public function baz(NS\Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'NS\Foo', 'baz', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/namespaced_class-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class.phpt index 60fa9c5de2d..b1582326846 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class.phpt @@ -40,7 +40,7 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(NS\Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php7.phpt deleted file mode 100644 index 4378cc48144..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php7.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone.phpt index a0c79a34bf4..b026d8bc35e 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_clone.phpt @@ -35,5 +35,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\UnmockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php7.phpt deleted file mode 100644 index ad2fafd7f1d..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor.phpt index 13ac98d12a8..248e47a6d2a 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor.phpt @@ -35,5 +35,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php7.phpt deleted file mode 100644 index fc776ae7127..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php7.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', false) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - false -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone.phpt index 7208b4226d1..2b44b13e884 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_clone.phpt @@ -35,5 +35,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php7.phpt deleted file mode 100644 index ad2fafd7f1d..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor.phpt index 13ac98d12a8..248e47a6d2a 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_dont_call_parent_constructor.phpt @@ -35,5 +35,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php7.phpt deleted file mode 100644 index 34f68051192..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor.phpt similarity index 91% rename from tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor.phpt index aebcbf28ba6..2cd2af6e12b 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_call_parent_constructor.phpt @@ -40,5 +40,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php7.phpt deleted file mode 100644 index 34f68051192..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php7.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt similarity index 91% rename from tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt index aebcbf28ba6..2cd2af6e12b 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt @@ -40,5 +40,5 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_partial-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_partial-php7.phpt deleted file mode 100644 index 67959012193..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_partial-php7.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array('bar'), 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - array('bar'), - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(NS\Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'NS\Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_class_partial-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/namespaced_class_partial-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt index d7cc4058fab..c2687a8ac7b 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_class_partial-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_class_partial.phpt @@ -40,7 +40,7 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(NS\Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/namespaced_interface-php7.phpt b/tests/end-to-end/mock-objects/generator/namespaced_interface-php7.phpt deleted file mode 100644 index e3c844509ed..00000000000 --- a/tests/end-to-end/mock-objects/generator/namespaced_interface-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, NS\Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(NS\Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'NS\Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/namespaced_interface-php8.phpt b/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/namespaced_interface-php8.phpt rename to tests/end-to-end/mock-objects/generator/namespaced_interface.phpt index fb0e204b107..5970ff18b90 100644 --- a/tests/end-to-end/mock-objects/generator/namespaced_interface-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/namespaced_interface.phpt @@ -34,7 +34,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, NS\Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(NS\Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class-php7.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class-php7.phpt deleted file mode 100644 index 373c5beffe2..00000000000 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class-php7.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('NonExistentClass', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NonExistentClass', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class NonExistentClass -{ -} - -class MockFoo extends NonExistentClass implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class-php8.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/nonexistent_class-php8.phpt rename to tests/end-to-end/mock-objects/generator/nonexistent_class.phpt index 4d6c8269f50..e373d99f525 100644 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/nonexistent_class.phpt @@ -31,5 +31,5 @@ class MockFoo extends NonExistentClass implements PHPUnit\Framework\MockObject\M { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php7.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php7.phpt deleted file mode 100644 index 4c82908fd56..00000000000 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php7.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'NS\Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -namespace NS { - -class Foo -{ -} - -} - -namespace { - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} - -} diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php8.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php8.phpt rename to tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace.phpt index 04ef86baff4..5be3a5568dc 100644 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace.phpt @@ -37,7 +37,7 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } } diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php7.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php7.phpt deleted file mode 100644 index ce7427f1a5e..00000000000 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php7.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - '\NS\Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -namespace NS { - -class Foo -{ -} - -} - -namespace { - -class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; -} - -} diff --git a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php8.phpt b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator.phpt similarity index 90% rename from tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php8.phpt rename to tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator.phpt index c7831e9501a..b77e7051252 100644 --- a/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/nonexistent_class_with_namespace_starting_with_separator.phpt @@ -37,7 +37,7 @@ class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; } } diff --git a/tests/end-to-end/mock-objects/generator/nullable_types-php7.phpt b/tests/end-to-end/mock-objects/generator/nullable_types-php7.phpt deleted file mode 100644 index a7b5b6d3189..00000000000 --- a/tests/end-to-end/mock-objects/generator/nullable_types-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(?int $x) - { - $__phpunit_arguments = [$x]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/nullable_types-php8.phpt b/tests/end-to-end/mock-objects/generator/nullable_types.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/nullable_types-php8.phpt rename to tests/end-to-end/mock-objects/generator/nullable_types.phpt index f8bcff6b3b2..2571750a96c 100644 --- a/tests/end-to-end/mock-objects/generator/nullable_types-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/nullable_types.phpt @@ -34,7 +34,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(?int $x) { 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 7cff26dff7e..f22bc763fd4 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 @@ -29,7 +29,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(int|bool $baz, Foo|stdClass|null $other) { 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 92a4fe6e80c..e18031e4f7f 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 @@ -29,7 +29,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): bool|int|null { diff --git a/tests/end-to-end/mock-objects/generator/proxy-php7.phpt b/tests/end-to-end/mock-objects/generator/proxy-php7.phpt deleted file mode 100644 index 17e3f2b0735..00000000000 --- a/tests/end-to-end/mock-objects/generator/proxy-php7.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', null, 'ProxyFoo', true, true, true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', [], 'ProxyFoo', true, true, true, true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true, true - ) - ); - - return call_user_func_array(array($this->__phpunit_originalObject, "bar"), $__phpunit_arguments); - } - - public function baz(Foo $foo) - { - $__phpunit_arguments = [$foo]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'baz', $__phpunit_arguments, '', $this, true, true - ) - ); - - return call_user_func_array(array($this->__phpunit_originalObject, "baz"), $__phpunit_arguments); - } -} diff --git a/tests/end-to-end/mock-objects/generator/proxy-php8.phpt b/tests/end-to-end/mock-objects/generator/proxy.phpt similarity index 96% rename from tests/end-to-end/mock-objects/generator/proxy-php8.phpt rename to tests/end-to-end/mock-objects/generator/proxy.phpt index e2fbe810376..21c7689fac4 100644 --- a/tests/end-to-end/mock-objects/generator/proxy-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/proxy.phpt @@ -34,7 +34,7 @@ class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(Foo $foo) { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php7.phpt deleted file mode 100644 index 298f2e33853..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php7.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(): Closure - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'Closure', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt index fc823626f80..ed5046d7573 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_closure-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_closure.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): Closure { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_final-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_final-php7.phpt deleted file mode 100644 index e1dd8be12c2..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_final-php7.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(): FinalClass - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'FinalClass', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_final-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_final-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt index 155d40d2b79..f14f1f0863d 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_final-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_final.phpt @@ -39,7 +39,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): FinalClass { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php7.phpt deleted file mode 100644 index 6255236a41f..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php7.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(): Generator - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'Generator', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt index 212547a1893..c704fd86183 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_generator-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_generator.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): Generator { 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 08669b0acea..a003a8d3baa 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 @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz): never { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php7.phpt deleted file mode 100644 index 6244c1a2430..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php7.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(string $baz): ?string - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '?string', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt index 26e03b3f3c5..f1f268fb827 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_nullable.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz): ?string { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php7.phpt deleted file mode 100644 index 4b1d50bb873..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php7.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(string $baz): Bar - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'Bar', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt index 89017ccc981..69d37d6876b 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_object_method.phpt @@ -35,7 +35,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz): Bar { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php7.phpt deleted file mode 100644 index d0476b63bc1..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php7.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Bar', [], 'MockBar', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Bar', - [], - 'MockBar', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockBar extends Bar implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function baz(): Foo - { - $__phpunit_arguments = []; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 0) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Bar', 'baz', $__phpunit_arguments, 'Foo', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt index f4ffb612ad0..ff4073485d3 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_parent-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_parent.phpt @@ -39,7 +39,7 @@ class MockBar extends Bar implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function baz(): Foo { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_self-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_self-php7.phpt deleted file mode 100644 index 537ce80daa5..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_self-php7.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(string $baz): Foo - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'Foo', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_self-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_self-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt index aeb780de7b9..b2732e74a80 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_self-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_self.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz): Foo { 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 cb060604b24..611b1508834 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 @@ -37,7 +37,7 @@ class MockClassWithStaticReturnTypes extends ClassWithStaticReturnTypes implemen { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function returnsStatic(): static { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php7.phpt deleted file mode 100644 index 72d96b310db..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php7.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public static function bar(string $baz): Bar - { - throw new \PHPUnit\Framework\MockObject\BadMethodCallException('Static method "bar" cannot be invoked on mock object'); - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method.phpt similarity index 92% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_static_method.phpt index 14b2d54af85..464d9f3bfee 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_static_method.phpt @@ -35,7 +35,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public static function bar(string $baz): Bar { diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_void-php7.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_void-php7.phpt deleted file mode 100644 index 664e9eb5d42..00000000000 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_void-php7.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(string $baz): void - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, 'void', $this, true - ) - ); - } -} diff --git a/tests/end-to-end/mock-objects/generator/return_type_declarations_void-php8.phpt b/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt similarity index 94% rename from tests/end-to-end/mock-objects/generator/return_type_declarations_void-php8.phpt rename to tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt index f92bdb903cc..f83e2ce7f4b 100644 --- a/tests/end-to-end/mock-objects/generator/return_type_declarations_void-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/return_type_declarations_void.phpt @@ -32,7 +32,7 @@ class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz): void { diff --git a/tests/end-to-end/mock-objects/generator/scalar_type_declarations-php7.phpt b/tests/end-to-end/mock-objects/generator/scalar_type_declarations-php7.phpt deleted file mode 100644 index 0f206492a11..00000000000 --- a/tests/end-to-end/mock-objects/generator/scalar_type_declarations-php7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true) ---SKIPIF-- -= 8) { - print 'skip: PHP 7 is required.'; -} ---FILE-- -generate( - 'Foo', - [], - 'MockFoo', - true, - true -); - -print $mock->getClassCode(); ---EXPECTF-- -declare(strict_types=1); - -class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject -{ - use \PHPUnit\Framework\MockObject\Api; - use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType; - - public function bar(string $baz) - { - $__phpunit_arguments = [$baz]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > 1) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = 1; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - 'Foo', 'bar', $__phpunit_arguments, '', $this, true - ) - ); - - return $__phpunit_result; - } -} diff --git a/tests/end-to-end/mock-objects/generator/scalar_type_declarations-php8.phpt b/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt similarity index 95% rename from tests/end-to-end/mock-objects/generator/scalar_type_declarations-php8.phpt rename to tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt index 8ab5fb242ca..7752c416015 100644 --- a/tests/end-to-end/mock-objects/generator/scalar_type_declarations-php8.phpt +++ b/tests/end-to-end/mock-objects/generator/scalar_type_declarations.phpt @@ -34,7 +34,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(string $baz) { diff --git a/tests/end-to-end/mock-objects/generator/union_type_parameter.phpt b/tests/end-to-end/mock-objects/generator/union_type_parameter.phpt index 87fd9d361d7..f6ea4bd4dcd 100644 --- a/tests/end-to-end/mock-objects/generator/union_type_parameter.phpt +++ b/tests/end-to-end/mock-objects/generator/union_type_parameter.phpt @@ -29,7 +29,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(int|bool $baz, Foo|stdClass $other) { diff --git a/tests/end-to-end/mock-objects/generator/union_type_return.phpt b/tests/end-to-end/mock-objects/generator/union_type_return.phpt index 557b3a52de6..285c567346b 100644 --- a/tests/end-to-end/mock-objects/generator/union_type_return.phpt +++ b/tests/end-to-end/mock-objects/generator/union_type_return.phpt @@ -29,7 +29,7 @@ class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject { use \PHPUnit\Framework\MockObject\Api; use \PHPUnit\Framework\MockObject\Method; - use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType; + use \PHPUnit\Framework\MockObject\MockedCloneMethod; public function bar(): bool|int {