summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-27 16:58:30 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-05-07 13:45:28 +0200
commitfd2db1192997f5778139ea8e9d25189c7c08af2c (patch)
tree242059c49aa51b47b6edc30a404fbc2dce764b49 /tests
parent49c4ab3c394a6e18ab09582bccf6a26d88c4a616 (diff)
downloadphp-git-fd2db1192997f5778139ea8e9d25189c7c08af2c.tar.gz
Always generate fatal error for LSP failures
RFC: https://wiki.php.net/rfc/lsp_errors
Diffstat (limited to 'tests')
-rw-r--r--tests/classes/inheritance_003.phpt4
-rw-r--r--tests/classes/inheritance_004.phpt6
-rw-r--r--tests/classes/method_override_optional_arg_001.phpt4
-rw-r--r--tests/classes/method_override_optional_arg_002.phpt3
-rw-r--r--tests/classes/type_hinting_005a.phpt10
-rw-r--r--tests/classes/type_hinting_005c.phpt7
-rw-r--r--tests/classes/type_hinting_005d.phpt7
7 files changed, 12 insertions, 29 deletions
diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt
index bcbead1be7..925544e754 100644
--- a/tests/classes/inheritance_003.phpt
+++ b/tests/classes/inheritance_003.phpt
@@ -14,7 +14,5 @@ class B extends A
}
?>
-===DONE===
--EXPECTF--
-Warning: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d
-===DONE===
+Fatal error: Declaration of B::f() must be compatible with A::f($x) in %sinheritance_003.php on line %d
diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt
index 7eb57b2770..682bee7a1b 100644
--- a/tests/classes/inheritance_004.phpt
+++ b/tests/classes/inheritance_004.phpt
@@ -5,7 +5,7 @@ ZE2 method inheritance without interfaces
class A
{
- function f() {}
+function f() {}
}
class B extends A
@@ -14,7 +14,5 @@ class B extends A
}
?>
-===DONE===
--EXPECTF--
-Warning: Declaration of B::f($x) should be compatible with A::f() in %sinheritance_004.php on line %d
-===DONE===
+Fatal error: Declaration of B::f($x) must be compatible with A::f() in %sinheritance_004.php on line %d
diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt
index 897a2c2b93..ac1a689238 100644
--- a/tests/classes/method_override_optional_arg_001.phpt
+++ b/tests/classes/method_override_optional_arg_001.phpt
@@ -26,6 +26,4 @@ $b->foo(1);
?>
--EXPECTF--
-Warning: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d
-int(1)
-int(3)
+Fatal error: Declaration of C::foo() must be compatible with A::foo($arg1 = 1) in %s on line %d
diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt
index 254392718b..df12251e6c 100644
--- a/tests/classes/method_override_optional_arg_002.phpt
+++ b/tests/classes/method_override_optional_arg_002.phpt
@@ -18,5 +18,4 @@ $b->foo();
?>
--EXPECTF--
-Warning: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d
-foo
+Fatal error: Declaration of B::foo() must be compatible with A::foo($arg = 1) in %s on line %d
diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt
index 54af0e8c96..065ba70e8a 100644
--- a/tests/classes/type_hinting_005a.phpt
+++ b/tests/classes/type_hinting_005a.phpt
@@ -4,15 +4,11 @@ Check type hint compatibility in overrides with array hints.
<?php
Class C { function f(array $a) {} }
-echo "Compatible hint.\n";
+// Compatible hint.
Class D1 extends C { function f(array $a) {} }
-echo "Class hint, should be array.\n";
+// Class hint, should be array.
Class D2 extends C { function f(SomeClass $a) {} }
?>
-==DONE==
--EXPECTF--
-Warning: Declaration of D2::f(SomeClass $a) should be compatible with C::f(array $a) in %s on line 8
-Compatible hint.
-Class hint, should be array.
-==DONE==
+Fatal error: Declaration of D2::f(SomeClass $a) must be compatible with C::f(array $a) in %s on line 8
diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt
index 00048c3ef9..6cc3e3e369 100644
--- a/tests/classes/type_hinting_005c.phpt
+++ b/tests/classes/type_hinting_005c.phpt
@@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints.
<?php
Class C { function f(SomeClass $a) {} }
-echo "Array hint, should be class.\n";
+// Array hint, should be class.
Class D extends C { function f(array $a) {} }
?>
-==DONE==
--EXPECTF--
-Warning: Declaration of D::f(array $a) should be compatible with C::f(SomeClass $a) in %s on line 5
-Array hint, should be class.
-==DONE==
+Fatal error: Declaration of D::f(array $a) must be compatible with C::f(SomeClass $a) in %s on line 5
diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt
index a1ce30950c..51c2a5a995 100644
--- a/tests/classes/type_hinting_005d.phpt
+++ b/tests/classes/type_hinting_005d.phpt
@@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints.
<?php
Class C { function f($a) {} }
-echo "Array hint, should be nothing.\n";
+// Array hint, should be nothing.
Class D extends C { function f(array $a) {} }
?>
-==DONE==
--EXPECTF--
-Warning: Declaration of D::f(array $a) should be compatible with C::f($a) in %s on line 5
-Array hint, should be nothing.
-==DONE==
+Fatal error: Declaration of D::f(array $a) must be compatible with C::f($a) in %s on line 5