summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations
diff options
context:
space:
mode:
authorGabriel Caruso <carusogabriel34@gmail.com>2018-02-04 16:42:36 -0200
committerNikita Popov <nikita.ppv@gmail.com>2018-02-04 23:09:40 +0100
commitfef879a2d63899ed25f39b4581c16682afdd0a8f (patch)
treece12aa17bbd2db3d0cfd2cabda46e4bcdb074686 /Zend/tests/type_declarations
parentce1d69a1f6dcf15d43029301059c25e5bc09a577 (diff)
downloadphp-git-fef879a2d63899ed25f39b4581c16682afdd0a8f.tar.gz
Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows "boolean" as an alias. This changes the error messages to match the actual type name and avoids confusing messages like "must be of type boolean, boolean given". This a followup to ce1d69a1f6dcf15d43029301059c25e5bc09a577, which implements the same change for integer->int.
Diffstat (limited to 'Zend/tests/type_declarations')
-rw-r--r--Zend/tests/type_declarations/scalar_basic.phpt10
-rw-r--r--Zend/tests/type_declarations/scalar_null.phpt2
-rw-r--r--Zend/tests/type_declarations/scalar_return_basic.phpt10
-rw-r--r--Zend/tests/type_declarations/scalar_return_basic_64bit.phpt10
-rw-r--r--Zend/tests/type_declarations/scalar_strict.phpt40
-rw-r--r--Zend/tests/type_declarations/scalar_strict_64bit.phpt40
-rw-r--r--Zend/tests/type_declarations/scalar_strict_basic.phpt26
7 files changed, 69 insertions, 69 deletions
diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt
index c2191b9e64..16e7875ff9 100644
--- a/Zend/tests/type_declarations/scalar_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_basic.phpt
@@ -257,21 +257,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, null given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, array given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying object(Stringable)#%s (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, resource given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt
index e3beb9feac..767e36e914 100644
--- a/Zend/tests/type_declarations/scalar_null.phpt
+++ b/Zend/tests/type_declarations/scalar_null.phpt
@@ -43,7 +43,7 @@ Testing float:
Testing string:
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d
Testing bool:
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, null given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d
Testing int nullable:
NULL
Testing float nullable:
diff --git a/Zend/tests/type_declarations/scalar_return_basic.phpt b/Zend/tests/type_declarations/scalar_return_basic.phpt
index cf58f91500..dd7a3daf85 100644
--- a/Zend/tests/type_declarations/scalar_return_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_return_basic.phpt
@@ -200,17 +200,17 @@ bool(true)
*** Trying bool(false)
bool(false)
*** Trying NULL
-*** Caught Return value of {closure}() must be of the type boolean, null returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, array returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d
*** Trying resource(5) of type (stream)
-*** Caught Return value of {closure}() must be of the type boolean, resource returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, resource returned in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
index 9c4217203f..bec8925676 100644
--- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
@@ -200,17 +200,17 @@ bool(true)
*** Trying bool(false)
bool(false)
*** Trying NULL
-*** Caught Return value of {closure}() must be of the type boolean, null returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, array returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) {
}
-*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d
*** Trying resource(5) of type (stream)
-*** Caught Return value of {closure}() must be of the type boolean, resource returned in %s on line %d
+*** Caught Return value of {closure}() must be of the type bool, resource returned in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict.phpt b/Zend/tests/type_declarations/scalar_strict.phpt
index afef18f6a3..4230558b01 100644
--- a/Zend/tests/type_declarations/scalar_strict.phpt
+++ b/Zend/tests/type_declarations/scalar_strict.phpt
@@ -94,10 +94,10 @@ int(2147483647)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d
@@ -147,10 +147,10 @@ float(2147483647)
float(NAN)
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d
@@ -200,10 +200,10 @@ string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d
@@ -226,31 +226,31 @@ string(0) ""
Testing 'bool' type:
*** Trying int(1)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d
*** Trying string(1) "1"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying float(1)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying int(2147483647)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying bool(true)
bool(true)
@@ -259,21 +259,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, null given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, array given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d
*** Trying object(stdClass)#6 (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying object(Stringable)#7 (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying resource(5) of type (stream)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, resource given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
index 914f0e6807..b2559afae9 100644
--- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
@@ -94,10 +94,10 @@ int(9223372036854775807)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d
@@ -147,10 +147,10 @@ float(9.2233720368548E+18)
float(NAN)
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d
@@ -200,10 +200,10 @@ string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying bool(false)
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d
@@ -226,31 +226,31 @@ string(0) ""
Testing 'bool' type:
*** Trying int(1)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d
*** Trying string(1) "1"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying float(1)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying int(9223372036854775807)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying bool(true)
bool(true)
@@ -259,21 +259,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, null given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, array given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d
*** Trying object(stdClass)#6 (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying object(Stringable)#7 (0) {
}
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying resource(5) of type (stream)
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, resource given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt
index 24dff2489d..87da5f9328 100644
--- a/Zend/tests/type_declarations/scalar_strict_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt
@@ -74,10 +74,10 @@ int(1)
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d
*** Trying true value
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying false value
-*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d
*** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d
@@ -103,10 +103,10 @@ float(1)
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d
*** Trying true value
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying false value
-*** Caught Argument 1 passed to {closure}() must be of the type float, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d
*** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d
@@ -132,10 +132,10 @@ Testing 'string' type:
string(1) "1"
*** Trying true value
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying false value
-*** Caught Argument 1 passed to {closure}() must be of the type string, boolean given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d
*** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d
@@ -152,13 +152,13 @@ string(1) "1"
Testing 'bool' type:
*** Trying integer value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d
*** Trying float value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d
*** Trying string value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d
*** Trying true value
bool(true)
@@ -167,15 +167,15 @@ bool(true)
bool(false)
*** Trying null value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, null given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d
*** Trying array value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, array given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d
*** Trying object value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, object given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d
*** Trying resource value
-*** Caught Argument 1 passed to {closure}() must be of the type boolean, resource given, called in %s on line %d
+*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d
Done