From 299cf7e78a39fb6789c73dfe2e372f9cc55b83bb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 24 May 2019 09:37:39 +0200 Subject: [PATCH] Split up "parent" test cases As the warnings are fatal errors in PHP 8, we can't test all of this in a single file anymore. --- .../variance/parent_in_class.phpt | 45 ------------------- .../variance/parent_in_class_failure1.phpt | 16 +++++++ .../variance/parent_in_class_failure2.phpt | 17 +++++++ .../variance/parent_in_class_success.phpt | 27 +++++++++++ 4 files changed, 60 insertions(+), 45 deletions(-) delete mode 100644 Zend/tests/type_declarations/variance/parent_in_class.phpt create mode 100644 Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt create mode 100644 Zend/tests/type_declarations/variance/parent_in_class_failure2.phpt create mode 100644 Zend/tests/type_declarations/variance/parent_in_class_success.phpt diff --git a/Zend/tests/type_declarations/variance/parent_in_class.phpt b/Zend/tests/type_declarations/variance/parent_in_class.phpt deleted file mode 100644 index 88b711bddd..0000000000 --- a/Zend/tests/type_declarations/variance/parent_in_class.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Use of parent inside a class that has / has no parent ---FILE-- - ---EXPECTF-- -Warning: Declaration of B4::method(A4 $x) should be compatible with A4::method(P4 $x) in %s on line %d - -Warning: Could not check compatibility between B::method(A $x) and A::method(parent $x), because class parent is not available in %s on line %d diff --git a/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt b/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt new file mode 100644 index 0000000000..5e1f43d875 --- /dev/null +++ b/Zend/tests/type_declarations/variance/parent_in_class_failure1.phpt @@ -0,0 +1,16 @@ +--TEST-- +Use of parent inside a class that has / has no parent (failure case 1) +--FILE-- + +--EXPECTF-- +Fatal error: Could not check compatibility between B::method(A $x) and A::method(parent $x), because class parent is not available in %s on line %d diff --git a/Zend/tests/type_declarations/variance/parent_in_class_failure2.phpt b/Zend/tests/type_declarations/variance/parent_in_class_failure2.phpt new file mode 100644 index 0000000000..f9902d8073 --- /dev/null +++ b/Zend/tests/type_declarations/variance/parent_in_class_failure2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Use of parent inside a class that has / has no parent (failure case 2) +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of B4::method(A4 $x) must be compatible with A4::method(P4 $x) in %s on line %d diff --git a/Zend/tests/type_declarations/variance/parent_in_class_success.phpt b/Zend/tests/type_declarations/variance/parent_in_class_success.phpt new file mode 100644 index 0000000000..c3edceaf3b --- /dev/null +++ b/Zend/tests/type_declarations/variance/parent_in_class_success.phpt @@ -0,0 +1,27 @@ +--TEST-- +Use of parent inside a class that has / has no parent (success cases) +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== -- 2.50.1