summaryrefslogtreecommitdiff
path: root/tests/classes
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-01-29 20:06:13 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-02-17 14:22:17 +0100
commitac0853eb265784c4238af652de9c54c883ffa99f (patch)
treee9316872480304e9e74ce89bd15052965cc18438 /tests/classes
parent72bd55902d1908857f47555ad69458861e1acd94 (diff)
downloadphp-git-ac0853eb265784c4238af652de9c54c883ffa99f.tar.gz
Make type error messages more consistent
Closes GH-5092
Diffstat (limited to 'tests/classes')
-rw-r--r--tests/classes/abstract_user_call.phpt2
-rw-r--r--tests/classes/autoload_009.phpt2
-rw-r--r--tests/classes/autoload_012.phpt2
-rw-r--r--tests/classes/bug27504.phpt2
-rw-r--r--tests/classes/tostring_004.phpt2
-rw-r--r--tests/classes/type_hinting_001.phpt2
-rw-r--r--tests/classes/type_hinting_002.phpt2
-rw-r--r--tests/classes/type_hinting_003.phpt2
-rw-r--r--tests/classes/type_hinting_004.phpt12
9 files changed, 14 insertions, 14 deletions
diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt
index 0a61d477b6..ad96101386 100644
--- a/tests/classes/abstract_user_call.phpt
+++ b/tests/classes/abstract_user_call.phpt
@@ -29,4 +29,4 @@ try {
?>
--EXPECT--
test::func()
-call_user_func() expects parameter 1 to be a valid callback, cannot call abstract method test_base::func()
+call_user_func() expects argument #1 ($function) to be a valid callback, cannot call abstract method test_base::func()
diff --git a/tests/classes/autoload_009.phpt b/tests/classes/autoload_009.phpt
index 63f1ea9801..7932fd4240 100644
--- a/tests/classes/autoload_009.phpt
+++ b/tests/classes/autoload_009.phpt
@@ -13,7 +13,7 @@ function f(UndefClass $x)
f(new stdClass);
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s on line %d and defined in %s:%d
+Fatal error: Uncaught TypeError: f() expects argument #1 ($x) to be of type UndefClass, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): f(Object(stdClass))
#1 {main}
diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt
index c5b32debae..7ed944dc48 100644
--- a/tests/classes/autoload_012.phpt
+++ b/tests/classes/autoload_012.phpt
@@ -14,4 +14,4 @@ try {
?>
--EXPECT--
In autoload: string(6) "UndefC"
-call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found
+call_user_func() expects argument #1 ($function) to be a valid callback, class 'UndefC' not found
diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt
index 4e227a1075..a56efde2d9 100644
--- a/tests/classes/bug27504.phpt
+++ b/tests/classes/bug27504.phpt
@@ -27,5 +27,5 @@ try {
?>
--EXPECT--
Called function foo:bar(1)
-call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar()
+call_user_func_array() expects argument #1 ($function) to be a valid callback, cannot access private method foo::bar()
Call to private method foo::bar() from context ''
diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt
index 8cde860d56..02968a9b3b 100644
--- a/tests/classes/tostring_004.phpt
+++ b/tests/classes/tostring_004.phpt
@@ -53,7 +53,7 @@ try {
--EXPECT--
Object with no __toString():
Try 1:
-printf() expects parameter 1 to be string, object given
+printf() expects argument #1 ($format) to be of type string, object given
Try 2:
diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt
index fdc74a3194..ca476187f3 100644
--- a/tests/classes/type_hinting_001.phpt
+++ b/tests/classes/type_hinting_001.phpt
@@ -32,7 +32,7 @@ $a->b($b);
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s:12
+Fatal error: Uncaught TypeError: FooBar::a() expects argument #1 ($foo) to be of type Foo, Blort given, called in %s on line 27 and defined in %s:12
Stack trace:
#0 %s(%d): FooBar->a(Object(Blort))
#1 {main}
diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt
index 23d201a51a..a491a26a62 100644
--- a/tests/classes/type_hinting_002.phpt
+++ b/tests/classes/type_hinting_002.phpt
@@ -11,7 +11,7 @@ $o = new Foo;
$o->a($o);
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s:%d
+Fatal error: Uncaught TypeError: Foo::a() expects argument #1 ($foo) to be of type NonExisting, Foo given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): Foo->a(Object(Foo))
#1 {main}
diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt
index 9dfbd7c3b8..c43f13dbef 100644
--- a/tests/classes/type_hinting_003.phpt
+++ b/tests/classes/type_hinting_003.phpt
@@ -57,7 +57,7 @@ array(1) {
int(25)
}
-Fatal error: Uncaught TypeError: Argument 1 passed to Test::f1() must be of the type array, int given, called in %s on line %d and defined in %s:%d
+Fatal error: Uncaught TypeError: Test::f1() expects argument #1 ($ar) to be of type array, int given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): Test::f1(1)
#1 {main}
diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt
index 27f15a3e16..299ec1dd46 100644
--- a/tests/classes/type_hinting_004.phpt
+++ b/tests/classes/type_hinting_004.phpt
@@ -144,10 +144,10 @@ Ensure type hints are enforced for functions invoked as callbacks.
?>
--EXPECTF--
---> Type hints with callback function:
-0: Argument 1 passed to f1() must be an instance of A, int given%s(%d)
+0: f1() expects argument #1 ($a) to be of type A, int given%s(%d)
in f1;
-0: Argument 1 passed to f2() must be an instance of A or null, int given%s(%d)
+0: f2() expects argument #1 ($a) to be of type ?A, int given%s(%d)
in f2;
in f2;
@@ -155,10 +155,10 @@ in f2;
---> Type hints with callback static method:
-0: Argument 1 passed to C::f1() must be an instance of A, int given%s(%d)
+0: C::f1() expects argument #1 ($a) to be of type A, int given%s(%d)
in C::f1 (static);
-0: Argument 1 passed to C::f2() must be an instance of A or null, int given%s(%d)
+0: C::f2() expects argument #1 ($a) to be of type ?A, int given%s(%d)
in C::f2 (static);
in C::f2 (static);
@@ -166,10 +166,10 @@ in C::f2 (static);
---> Type hints with callback instance method:
-0: Argument 1 passed to D::f1() must be an instance of A, int given%s(%d)
+0: D::f1() expects argument #1 ($a) to be of type A, int given%s(%d)
in C::f1 (instance);
-0: Argument 1 passed to D::f2() must be an instance of A or null, int given%s(%d)
+0: D::f2() expects argument #1 ($a) to be of type ?A, int given%s(%d)
in C::f2 (instance);
in C::f2 (instance);