summaryrefslogtreecommitdiff
path: root/ext/spl/tests
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 /ext/spl/tests
parent72bd55902d1908857f47555ad69458861e1acd94 (diff)
downloadphp-git-ac0853eb265784c4238af652de9c54c883ffa99f.tar.gz
Make type error messages more consistent
Closes GH-5092
Diffstat (limited to 'ext/spl/tests')
-rw-r--r--ext/spl/tests/CallbackFilterIteratorTest-002.phpt4
-rw-r--r--ext/spl/tests/SplFileInfo_setFileClass_error.phpt2
-rw-r--r--ext/spl/tests/SplFileInfo_setInfoClass_error.phpt2
-rw-r--r--ext/spl/tests/SplFixedArray__construct_param_array.phpt2
-rw-r--r--ext/spl/tests/SplFixedArray__construct_param_string.phpt2
-rw-r--r--ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt2
-rw-r--r--ext/spl/tests/SplTempFileObject_constructor_error.phpt2
-rw-r--r--ext/spl/tests/arrayObject___construct_error1.phpt4
-rw-r--r--ext/spl/tests/arrayObject_asort_basic1.phpt2
-rw-r--r--ext/spl/tests/arrayObject_ksort_basic1.phpt2
-rw-r--r--ext/spl/tests/arrayObject_setIteratorClass_error1.phpt10
-rw-r--r--ext/spl/tests/bug54291.phpt2
-rw-r--r--ext/spl/tests/bug54292.phpt2
-rw-r--r--ext/spl/tests/bug77431.phpt4
-rw-r--r--ext/spl/tests/bug78863.phpt2
-rw-r--r--ext/spl/tests/fixedarray_005.phpt6
-rw-r--r--ext/spl/tests/fixedarray_009.phpt2
-rw-r--r--ext/spl/tests/fixedarray_015.phpt2
-rw-r--r--ext/spl/tests/iterator_042.phpt2
-rw-r--r--ext/spl/tests/iterator_044.phpt8
-rw-r--r--ext/spl/tests/iterator_count.phpt2
-rw-r--r--ext/spl/tests/iterator_to_array.phpt2
-rw-r--r--ext/spl/tests/recursive_tree_iterator_003.phpt2
-rw-r--r--ext/spl/tests/spl_004.phpt4
24 files changed, 37 insertions, 37 deletions
diff --git a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt
index 62beb88cd5..e1d37ecce5 100644
--- a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt
+++ b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt
@@ -43,6 +43,6 @@ try {
--EXPECT--
CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given
CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given
-CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, no array or string given
-CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, array must have exactly two members
+CallbackFilterIterator::__construct() expects argument #2 ($callback) to be a valid callback, no array or string given
+CallbackFilterIterator::__construct() expects argument #2 ($callback) to be a valid callback, array must have exactly two members
some message
diff --git a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt
index db0186f218..b8aea64ea2 100644
--- a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt
+++ b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt
@@ -13,4 +13,4 @@ try {
?>
--EXPECT--
-SplFileInfo::setFileClass() expects parameter 1 to be a class name derived from SplFileObject, 'stdClass' given
+SplFileInfo::setFileClass() expects argument #1 ($class_name) to be a class name derived from SplFileObject, 'stdClass' given
diff --git a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt
index 9a2e71defe..b0a358a9b3 100644
--- a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt
+++ b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt
@@ -13,4 +13,4 @@ try {
?>
--EXPECT--
-SplFileInfo::setInfoClass() expects parameter 1 to be a class name derived from SplFileInfo, 'stdClass' given
+SplFileInfo::setInfoClass() expects argument #1 ($class_name) to be a class name derived from SplFileInfo, 'stdClass' given
diff --git a/ext/spl/tests/SplFixedArray__construct_param_array.phpt b/ext/spl/tests/SplFixedArray__construct_param_array.phpt
index 15e1c0c438..f4fb329989 100644
--- a/ext/spl/tests/SplFixedArray__construct_param_array.phpt
+++ b/ext/spl/tests/SplFixedArray__construct_param_array.phpt
@@ -13,4 +13,4 @@ try {
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, array given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, array given
diff --git a/ext/spl/tests/SplFixedArray__construct_param_string.phpt b/ext/spl/tests/SplFixedArray__construct_param_string.phpt
index 654ac4b95f..240631cc88 100644
--- a/ext/spl/tests/SplFixedArray__construct_param_string.phpt
+++ b/ext/spl/tests/SplFixedArray__construct_param_string.phpt
@@ -13,4 +13,4 @@ try {
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, string given
diff --git a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt
index efb1d0e65d..cfb0ca79a9 100644
--- a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt
+++ b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt
@@ -12,4 +12,4 @@ try {
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, object given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, object given
diff --git a/ext/spl/tests/SplTempFileObject_constructor_error.phpt b/ext/spl/tests/SplTempFileObject_constructor_error.phpt
index 37b00991ff..aaf2738915 100644
--- a/ext/spl/tests/SplTempFileObject_constructor_error.phpt
+++ b/ext/spl/tests/SplTempFileObject_constructor_error.phpt
@@ -9,4 +9,4 @@ try {
}
?>
--EXPECT--
-SplTempFileObject::__construct() expects parameter 1 to be int, string given
+SplTempFileObject::__construct() expects argument #1 ($max_memory) to be of type int, string given
diff --git a/ext/spl/tests/arrayObject___construct_error1.phpt b/ext/spl/tests/arrayObject___construct_error1.phpt
index aaf38ac499..b7700e4e31 100644
--- a/ext/spl/tests/arrayObject___construct_error1.phpt
+++ b/ext/spl/tests/arrayObject___construct_error1.phpt
@@ -20,6 +20,6 @@ try {
?>
--EXPECT--
Bad iterator type:
-ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'Exception' given(6)
+ArrayObject::__construct() expects argument #3 ($iterator_class) to be a class name derived from Iterator, 'Exception' given(6)
Non-existent class:
-ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClassName' given(13)
+ArrayObject::__construct() expects argument #3 ($iterator_class) to be a class name derived from Iterator, 'nonExistentClassName' given(13)
diff --git a/ext/spl/tests/arrayObject_asort_basic1.phpt b/ext/spl/tests/arrayObject_asort_basic1.phpt
index 0ec5269692..db751c6fba 100644
--- a/ext/spl/tests/arrayObject_asort_basic1.phpt
+++ b/ext/spl/tests/arrayObject_asort_basic1.phpt
@@ -38,7 +38,7 @@ object(ArrayObject)#%d (1) {
int(4)
}
}
-asort() expects parameter 2 to be int, string given
+asort() expects argument #2 ($sort_flags) to be of type int, string given
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(3) {
diff --git a/ext/spl/tests/arrayObject_ksort_basic1.phpt b/ext/spl/tests/arrayObject_ksort_basic1.phpt
index 01375b7277..6e20013177 100644
--- a/ext/spl/tests/arrayObject_ksort_basic1.phpt
+++ b/ext/spl/tests/arrayObject_ksort_basic1.phpt
@@ -37,7 +37,7 @@ object(ArrayObject)#%d (1) {
int(3)
}
}
-ksort() expects parameter 2 to be int, string given
+ksort() expects argument #2 ($sort_flags) to be of type int, string given
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(4) {
diff --git a/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt b/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
index 591f84c3d4..a80c8cbb0d 100644
--- a/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
+++ b/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
@@ -42,8 +42,8 @@ try {
}
?>
---EXPECTF--
-string(118) "ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'nonExistentClass' given"
-string(110) "ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'stdClass' given"
-string(113) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClass' given"
-string(105) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'stdClass' given"
+--EXPECT--
+string(135) "ArrayObject::setIteratorClass() expects argument #1 ($iteratorClass) to be a class name derived from Iterator, 'nonExistentClass' given"
+string(127) "ArrayObject::setIteratorClass() expects argument #1 ($iteratorClass) to be a class name derived from Iterator, 'stdClass' given"
+string(131) "ArrayObject::__construct() expects argument #3 ($iterator_class) to be a class name derived from Iterator, 'nonExistentClass' given"
+string(123) "ArrayObject::__construct() expects argument #3 ($iterator_class) to be a class name derived from Iterator, 'stdClass' given"
diff --git a/ext/spl/tests/bug54291.phpt b/ext/spl/tests/bug54291.phpt
index 9f3bd49912..e48f80fe00 100644
--- a/ext/spl/tests/bug54291.phpt
+++ b/ext/spl/tests/bug54291.phpt
@@ -5,7 +5,7 @@ Bug #54291 (Crash iterating DirectoryIterator for dir name starting with \0)
$dir = new DirectoryIterator("\x00/abc");
$dir->isFile();
--EXPECTF--
-Fatal error: Uncaught TypeError: DirectoryIterator::__construct() expects parameter 1 to be a valid path, string given in %s:%d
+Fatal error: Uncaught TypeError: DirectoryIterator::__construct() expects argument #1 ($path) to be a valid path, string given in %s:%d
Stack trace:
#0 %s(%d): DirectoryIterator->__construct('\x00/abc')
#1 {main}
diff --git a/ext/spl/tests/bug54292.phpt b/ext/spl/tests/bug54292.phpt
index ac0cee10d4..9355ef4408 100644
--- a/ext/spl/tests/bug54292.phpt
+++ b/ext/spl/tests/bug54292.phpt
@@ -11,4 +11,4 @@ try {
?>
--EXPECT--
-string(74) "SplFileObject::__construct() expects parameter 2 to be string, array given"
+string(95) "SplFileObject::__construct() expects argument #2 ($open_mode) to be of type string, array given"
diff --git a/ext/spl/tests/bug77431.phpt b/ext/spl/tests/bug77431.phpt
index eb1ca96b75..20545fb141 100644
--- a/ext/spl/tests/bug77431.phpt
+++ b/ext/spl/tests/bug77431.phpt
@@ -5,5 +5,5 @@ Bug #77431 (SplFileInfo::__construct() accepts NUL bytes)
new SplFileInfo("bad\0good");
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: SplFileInfo::__construct() expects parameter 1 to be a valid path, string given in %s:%d
-Stack trace:%A \ No newline at end of file
+Fatal error: Uncaught TypeError: SplFileInfo::__construct() expects argument #1 ($file_name) to be a valid path, string given in %s:%d
+Stack trace:%A
diff --git a/ext/spl/tests/bug78863.phpt b/ext/spl/tests/bug78863.phpt
index c08c88a5d7..4db36c202e 100644
--- a/ext/spl/tests/bug78863.phpt
+++ b/ext/spl/tests/bug78863.phpt
@@ -16,7 +16,7 @@ foreach ($it as $fileinfo) {
}
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: DirectoryIterator::__construct() expects parameter 1 to be a valid path, string given in %s:%d
+Fatal error: Uncaught TypeError: DirectoryIterator::__construct() expects argument #1 ($path) to be a valid path, string given in %s:%d
Stack trace:
#0 %s(%d): DirectoryIterator->__construct('%s')
#1 {main}
diff --git a/ext/spl/tests/fixedarray_005.phpt b/ext/spl/tests/fixedarray_005.phpt
index 7295a317ab..80fffd1566 100644
--- a/ext/spl/tests/fixedarray_005.phpt
+++ b/ext/spl/tests/fixedarray_005.phpt
@@ -23,6 +23,6 @@ try {
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, object given
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, object given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, string given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, string given
diff --git a/ext/spl/tests/fixedarray_009.phpt b/ext/spl/tests/fixedarray_009.phpt
index 71d6a42a6f..6dc6e4cbca 100644
--- a/ext/spl/tests/fixedarray_009.phpt
+++ b/ext/spl/tests/fixedarray_009.phpt
@@ -10,4 +10,4 @@ try {
}
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, string given
diff --git a/ext/spl/tests/fixedarray_015.phpt b/ext/spl/tests/fixedarray_015.phpt
index 2a2d5a26f7..74814268e7 100644
--- a/ext/spl/tests/fixedarray_015.phpt
+++ b/ext/spl/tests/fixedarray_015.phpt
@@ -12,5 +12,5 @@ try {
echo "Done\n";
?>
--EXPECT--
-Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
+Ok - SplFixedArray::__construct() expects argument #1 ($size) to be of type int, string given
Done
diff --git a/ext/spl/tests/iterator_042.phpt b/ext/spl/tests/iterator_042.phpt
index 2c14fc3d40..f768e47077 100644
--- a/ext/spl/tests/iterator_042.phpt
+++ b/ext/spl/tests/iterator_042.phpt
@@ -39,7 +39,7 @@ foreach($it as $k => $v)
?>
--EXPECTF--
-Error AppendIterator::append() expects parameter 1 to be Iterator, array given in %s on line %d
+Error AppendIterator::append() expects argument #1 ($iterator) to be of type Iterator, array given in %s on line %d
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(2) {
diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt
index 89d8bef772..c62abb5c1a 100644
--- a/ext/spl/tests/iterator_044.phpt
+++ b/ext/spl/tests/iterator_044.phpt
@@ -83,8 +83,8 @@ NULL
===1===
object(stdClass)#%d (0) {
}
-CachingIterator::offsetExists() expects parameter 1 to be string, object given
-CachingIterator::offsetGet() expects parameter 1 to be string, object given
+CachingIterator::offsetExists() expects argument #1 ($index) to be of type string, object given
+CachingIterator::offsetGet() expects argument #1 ($index) to be of type string, object given
===2===
object(MyFoo)#%d (0) {
}
@@ -124,8 +124,8 @@ int(0)
===1===
object(stdClass)#1 (0) {
}
-CachingIterator::offsetExists() expects parameter 1 to be string, object given
-CachingIterator::offsetGet() expects parameter 1 to be string, object given
+CachingIterator::offsetExists() expects argument #1 ($index) to be of type string, object given
+CachingIterator::offsetGet() expects argument #1 ($index) to be of type string, object given
===2===
object(MyFoo)#2 (0) {
}
diff --git a/ext/spl/tests/iterator_count.phpt b/ext/spl/tests/iterator_count.phpt
index a115a7329c..3071f9b06c 100644
--- a/ext/spl/tests/iterator_count.phpt
+++ b/ext/spl/tests/iterator_count.phpt
@@ -13,7 +13,7 @@ iterator_count('1');
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: iterator_count() expects parameter 1 to be Traversable, string given in %s:%d
+Fatal error: Uncaught TypeError: iterator_count() expects argument #1 ($iterator) to be of type Traversable, string given in %s:%d
Stack trace:
#0 %s(%d): iterator_count('1')
#1 {main}
diff --git a/ext/spl/tests/iterator_to_array.phpt b/ext/spl/tests/iterator_to_array.phpt
index 9225f03c00..09dcf5d02f 100644
--- a/ext/spl/tests/iterator_to_array.phpt
+++ b/ext/spl/tests/iterator_to_array.phpt
@@ -13,7 +13,7 @@ iterator_to_array('test','test');
?>
--EXPECTF--
-Fatal error: Uncaught TypeError: iterator_to_array() expects parameter 1 to be Traversable, string given in %s:%d
+Fatal error: Uncaught TypeError: iterator_to_array() expects argument #1 ($iterator) to be of type Traversable, string given in %s:%d
Stack trace:
#0 %s(%d): iterator_to_array('test', 'test')
#1 {main}
diff --git a/ext/spl/tests/recursive_tree_iterator_003.phpt b/ext/spl/tests/recursive_tree_iterator_003.phpt
index c87f942f0d..0f4fed97b3 100644
--- a/ext/spl/tests/recursive_tree_iterator_003.phpt
+++ b/ext/spl/tests/recursive_tree_iterator_003.phpt
@@ -9,4 +9,4 @@ try {
}
?>
--EXPECT--
-RecursiveCachingIterator::__construct() expects parameter 1 to be RecursiveIterator, object given
+RecursiveCachingIterator::__construct() expects argument #1 ($iterator) to be of type RecursiveIterator, object given
diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt
index 570b4ae226..0b628d3ee1 100644
--- a/ext/spl/tests/spl_004.phpt
+++ b/ext/spl/tests/spl_004.phpt
@@ -84,6 +84,6 @@ int(5)
int(6)
int(4)
===ERRORS===
-iterator_apply() expects parameter 3 to be array, int given
-iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name
+iterator_apply() expects argument #3 ($args) to be of type array, int given
+iterator_apply() expects argument #2 ($function) to be a valid callback, function 'non_existing_function' not found or invalid function name
iterator_apply() expects at most 3 parameters, 4 given