diff --git a/composer.json b/composer.json index 16d4b6eed..7cac85f7d 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": ">=8.1", - "respect/stringifier": "^0.2.0", + "respect/stringifier": "^2.0.0", "symfony/polyfill-mbstring": "^1.2" }, "require-dev": { diff --git a/tests/integration/do_not_rely_on_nested_validation_exception_interface_for_check.phpt b/tests/integration/do_not_rely_on_nested_validation_exception_interface_for_check.phpt index d644a7a47..95c3bcc70 100644 --- a/tests/integration/do_not_rely_on_nested_validation_exception_interface_for_check.phpt +++ b/tests/integration/do_not_rely_on_nested_validation_exception_interface_for_check.phpt @@ -23,4 +23,4 @@ try { } ?> --EXPECT-- -"really messed up screen#name" must contain only letters (a-z), digits (0-9) and "_" +"really messed up screen#name" must contain only letters (a-z), digits (0-9) and `_(string $message): string` diff --git a/tests/integration/issue-1033.phpt b/tests/integration/issue-1033.phpt index d47bde25c..59645908f 100644 --- a/tests/integration/issue-1033.phpt +++ b/tests/integration/issue-1033.phpt @@ -3,8 +3,8 @@ Henrique Moody --DESCRIPTION-- The previous output was: -- All of the required rules must pass for `{ "A", "B", "B" }` -- Each item in `{ "A", "B", "B" }` must be valid +- All of the required rules must pass for `["A", "B", "B"]` +- Each item in `["A", "B", "B"]` must be valid - "A" must equal 1 - "B" must equal 1 - "B" must equal 1 @@ -20,7 +20,7 @@ use Respect\Validation\Validator as v; exceptionFullMessage(static fn() => v::each(v::equals(1))->assert(['A', 'B', 'B'])); ?> --EXPECT-- -- Each item in `{ "A", "B", "B" }` must be valid +- Each item in `["A", "B", "B"]` must be valid - "A" must equal 1 - "B" must equal 1 - "B" must equal 1 diff --git a/tests/integration/issue-1289.phpt b/tests/integration/issue-1289.phpt index bae2c8aa1..214492332 100644 --- a/tests/integration/issue-1289.phpt +++ b/tests/integration/issue-1289.phpt @@ -58,7 +58,7 @@ exceptionFullMessage(static fn() => $validator->assert($input)); ?> --EXPECT-- default must be of type string -- These rules must pass for `{ "default": 2, "description": { }, "children": { "nope" } }` +- These rules must pass for `["default": 2, "description": [], "children": ["nope"]]` - Only one of these rules must pass for default - default must be of type string - default must be of type boolean diff --git a/tests/integration/issue-1348.phpt b/tests/integration/issue-1348.phpt index e4d7956ab..2c6ab63ed 100644 --- a/tests/integration/issue-1348.phpt +++ b/tests/integration/issue-1348.phpt @@ -34,8 +34,8 @@ Array ( [each] => Array ( - [validator.0] => All of the required rules must pass for `{ "manufacturer": "Ford", "model": "not real" }` - [validator.1] => All of the required rules must pass for `{ "manufacturer": "Honda", "model": "not valid" }` + [validator.0] => All of the required rules must pass for `["manufacturer": "Ford", "model": "not real"]` + [validator.1] => All of the required rules must pass for `["manufacturer": "Honda", "model": "not valid"]` ) ) diff --git a/tests/integration/issue-1376.phpt b/tests/integration/issue-1376.phpt index 5be54eb0e..0f3b40578 100644 --- a/tests/integration/issue-1376.phpt +++ b/tests/integration/issue-1376.phpt @@ -38,7 +38,7 @@ try { } ?> --EXPECT-- -- All of the required rules must pass for `[object] (stdClass: { "author": "foo" })` +- All of the required rules must pass for `stdClass { +$author="foo" }` - Attribute title must be present - Attribute description must be present - All of the required rules must pass for author diff --git a/tests/integration/issue-425.phpt b/tests/integration/issue-425.phpt index ffe760861..da7b662fc 100644 --- a/tests/integration/issue-425.phpt +++ b/tests/integration/issue-425.phpt @@ -17,7 +17,7 @@ exceptionFullMessage(static fn() => $validator->assert(['age' => 1])); exceptionFullMessage(static fn() => $validator->assert(['reference' => 'QSF1234'])); ?> --EXPECT-- -- These rules must pass for `{ "age": 1 }` +- These rules must pass for `["age": 1]` - reference must be present -- These rules must pass for `{ "reference": "QSF1234" }` +- These rules must pass for `["reference": "QSF1234"]` - age must be present diff --git a/tests/integration/rules/alwaysValid.phpt b/tests/integration/rules/alwaysValid.phpt index 584c9ea0b..98a431b95 100644 --- a/tests/integration/rules/alwaysValid.phpt +++ b/tests/integration/rules/alwaysValid.phpt @@ -13,5 +13,5 @@ exceptionMessage(static fn() => v::not(v::alwaysValid())->check(true)); exceptionFullMessage(static fn() => v::not(v::alwaysValid())->assert(true)); ?> --EXPECT-- -`TRUE` is always invalid -- `TRUE` is always invalid +`true` is always invalid +- `true` is always invalid diff --git a/tests/integration/rules/arrayType.phpt b/tests/integration/rules/arrayType.phpt index 559c30351..bb5d481de 100644 --- a/tests/integration/rules/arrayType.phpt +++ b/tests/integration/rules/arrayType.phpt @@ -17,6 +17,6 @@ exceptionFullMessage(static fn() => v::not(v::arrayType())->assert([1, 2, 3])); ?> --EXPECT-- "teste" must be of type array -`{ }` must not be of type array -- `[traversable] (ArrayObject: { })` must be of type array -- `{ 1, 2, 3 }` must not be of type array +`[]` must not be of type array +- `ArrayObject { getArrayCopy() => [] }` must be of type array +- `[1, 2, 3]` must not be of type array diff --git a/tests/integration/rules/arrayVal.phpt b/tests/integration/rules/arrayVal.phpt index 653650b16..6bf60fefd 100644 --- a/tests/integration/rules/arrayVal.phpt +++ b/tests/integration/rules/arrayVal.phpt @@ -17,6 +17,6 @@ exceptionFullMessage(static fn() => v::not(v::arrayVal())->assert(new ArrayObjec ?> --EXPECT-- "Bla %123" must be an array value -`{ 42 }` must not be an array value -- `[object] (stdClass: { })` must be an array value -- `[traversable] (ArrayObject: { 2, 3 })` must not be an array value +`[42]` must not be an array value +- `stdClass {}` must be an array value +- `ArrayObject { getArrayCopy() => [2, 3] }` must not be an array value diff --git a/tests/integration/rules/boolType.phpt b/tests/integration/rules/boolType.phpt index 0e585fba9..ea5f8ce35 100644 --- a/tests/integration/rules/boolType.phpt +++ b/tests/integration/rules/boolType.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::boolType())->assert(false)); ?> --EXPECT-- "teste" must be of type boolean -`TRUE` must not be of type boolean -- `{ }` must be of type boolean -- `FALSE` must not be of type boolean +`true` must not be of type boolean +- `[]` must be of type boolean +- `false` must not be of type boolean diff --git a/tests/integration/rules/call.phpt b/tests/integration/rules/call.phpt index 229583bb7..007635d23 100644 --- a/tests/integration/rules/call.phpt +++ b/tests/integration/rules/call.phpt @@ -18,8 +18,8 @@ exceptionFullMessage(static fn() => v::call('array_walk', v::alwaysValid())->ass ?> --EXPECT-- "two words" must not contain whitespace -" something " must not be valid when executed with "trim" -`{ }` must be valid when executed with "trim" +" something " must not be valid when executed with `trim(string $string, string $characters = " \n\r\t\u000b\u0000"): string` +`[]` must be valid when executed with `trim(string $string, string $characters = " \n\r\t\u000b\u0000"): string` - "1234" must be of type integer -- 1.2 must not be valid when executed with "is_float" -- `INF` must be valid when executed with "array_walk" +- 1.2 must not be valid when executed with `is_float(?mixed $value): bool` +- `INF` must be valid when executed with `array_walk(object|array &$array, callable $callback, ?mixed $arg = null): true` diff --git a/tests/integration/rules/callableType.phpt b/tests/integration/rules/callableType.phpt index a71d9e49c..a6f049078 100644 --- a/tests/integration/rules/callableType.phpt +++ b/tests/integration/rules/callableType.phpt @@ -21,7 +21,7 @@ try { } ?> --EXPECT-- -`{ }` must be callable -"trim" must not be callable -- `TRUE` must be callable -- `[object] (Closure: { })` must not be callable +`[]` must be callable +`trim(string $string, string $characters = " \n\r\t\u000b\u0000"): string` must not be callable +- `true` must be callable +- `function (): void` must not be callable diff --git a/tests/integration/rules/callback.phpt b/tests/integration/rules/callback.phpt index 103f74023..406f0f328 100644 --- a/tests/integration/rules/callback.phpt +++ b/tests/integration/rules/callback.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::callback('is_string')->assert(true)); exceptionFullMessage(static fn() => v::not(v::callback('is_string'))->assert('foo')); ?> --EXPECT-- -`{ }` must be valid +`[]` must be valid "foo" must not be valid -- `TRUE` must be valid +- `true` must be valid - "foo" must not be valid diff --git a/tests/integration/rules/charset.phpt b/tests/integration/rules/charset.phpt index 525c9051c..1407d56f2 100644 --- a/tests/integration/rules/charset.phpt +++ b/tests/integration/rules/charset.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::charset('ASCII')->assert('açaí')); exceptionFullMessage(static fn() => v::not(v::charset('UTF-8'))->assert('açaí')); ?> --EXPECT-- -"açaí" must be in the `{ "ASCII" }` charset -"açaí" must not be in the `{ "UTF-8" }` charset -- "açaí" must be in the `{ "ASCII" }` charset -- "açaí" must not be in the `{ "UTF-8" }` charset +"açaí" must be in the `["ASCII"]` charset +"açaí" must not be in the `["UTF-8"]` charset +- "açaí" must be in the `["ASCII"]` charset +- "açaí" must not be in the `["UTF-8"]` charset diff --git a/tests/integration/rules/contains.phpt b/tests/integration/rules/contains.phpt index bb7ae519f..442fdb0d5 100644 --- a/tests/integration/rules/contains.phpt +++ b/tests/integration/rules/contains.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::contains('foo', true))->assert(['b --EXPECT-- "bar" must contain the value "foo" "fool" must not contain the value "foo" -- `{ "bar" }` must contain the value "foo" -- `{ "bar", "foo" }` must not contain the value "foo" +- `["bar"]` must contain the value "foo" +- `["bar", "foo"]` must not contain the value "foo" diff --git a/tests/integration/rules/containsAny.phpt b/tests/integration/rules/containsAny.phpt index 3f90261bc..241f04bfa 100644 --- a/tests/integration/rules/containsAny.phpt +++ b/tests/integration/rules/containsAny.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::containsAny(['foo', 'bar'])->assert(['baz exceptionFullMessage(static fn() => v::not(v::containsAny(['foo', 'bar'], true))->assert(['bar', 'foo'])); ?> --EXPECT-- -"baz" must contain at least one of the values `{ "foo", "bar" }` -"fool" must not contain any of the values `{ "foo", "bar" }` -- `{ "baz" }` must contain at least one of the values `{ "foo", "bar" }` -- `{ "bar", "foo" }` must not contain any of the values `{ "foo", "bar" }` +"baz" must contain at least one of the values `["foo", "bar"]` +"fool" must not contain any of the values `["foo", "bar"]` +- `["baz"]` must contain at least one of the values `["foo", "bar"]` +- `["bar", "foo"]` must not contain any of the values `["foo", "bar"]` diff --git a/tests/integration/rules/countable.phpt b/tests/integration/rules/countable.phpt index fa95cc0a8..18995beef 100644 --- a/tests/integration/rules/countable.phpt +++ b/tests/integration/rules/countable.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::countable())->assert(new ArrayObje ?> --EXPECT-- 1.0 must be countable -`{ }` must not be countable +`[]` must not be countable - "Not countable!" must be countable -- `[traversable] (ArrayObject: { })` must not be countable +- `ArrayObject { getArrayCopy() => [] }` must not be countable diff --git a/tests/integration/rules/each.phpt b/tests/integration/rules/each.phpt index 93ff86793..046e5da9f 100644 --- a/tests/integration/rules/each.phpt +++ b/tests/integration/rules/each.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::each(v::dateTime())->assert(null)); exceptionFullMessage(static fn() => v::not(v::each(v::dateTime()))->assert(['2018-10-10'])); ?> --EXPECT-- -Each item in `NULL` must be valid -Each item in `{ "2018-10-10" }` must not validate -- Each item in `NULL` must be valid -- Each item in `{ "2018-10-10" }` must not validate +Each item in `null` must be valid +Each item in `["2018-10-10"]` must not validate +- Each item in `null` must be valid +- Each item in `["2018-10-10"]` must not validate diff --git a/tests/integration/rules/endsWith.phpt b/tests/integration/rules/endsWith.phpt index 1141190b0..e955d41df 100644 --- a/tests/integration/rules/endsWith.phpt +++ b/tests/integration/rules/endsWith.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::endsWith('foo'))->assert(['bar', ' ?> --EXPECT-- "bar" must end with "foo" -`{ "bar", "foo" }` must not end with "foo" +`["bar", "foo"]` must not end with "foo" - "" must end with "foo" -- `{ "bar", "foo" }` must not end with "foo" +- `["bar", "foo"]` must not end with "foo" diff --git a/tests/integration/rules/equivalent.phpt b/tests/integration/rules/equivalent.phpt index ee49292e7..30836d0dd 100644 --- a/tests/integration/rules/equivalent.phpt +++ b/tests/integration/rules/equivalent.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::equivalent(123)->assert('true')); exceptionFullMessage(static fn() => v::not(v::equivalent(true))->assert(1)); ?> --EXPECT-- -`FALSE` must be equivalent to `TRUE` +`false` must be equivalent to `true` "someThing" must not be equivalent to "Something" - "true" must be equivalent to 123 -- 1 must not be equivalent to `TRUE` +- 1 must not be equivalent to `true` diff --git a/tests/integration/rules/falseVal.phpt b/tests/integration/rules/falseVal.phpt index ff044136b..1c64eb4c6 100644 --- a/tests/integration/rules/falseVal.phpt +++ b/tests/integration/rules/falseVal.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::falseVal()->assert(1)); exceptionFullMessage(static fn() => v::not(v::falseVal())->assert(0)); ?> --EXPECT-- -`TRUE` must evaluate to `false` +`true` must evaluate to `false` "false" must not evaluate to `false` - 1 must evaluate to `false` - 0 must not evaluate to `false` diff --git a/tests/integration/rules/finite.phpt b/tests/integration/rules/finite.phpt index a6b37f992..487524274 100644 --- a/tests/integration/rules/finite.phpt +++ b/tests/integration/rules/finite.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::finite())->assert('123456')); --EXPECT-- "" must be a finite number 10 must not be a finite number -- `{ 12 }` must be a finite number +- `[12]` must be a finite number - "123456" must not be a finite number diff --git a/tests/integration/rules/floatType.phpt b/tests/integration/rules/floatType.phpt index b42a47190..1ccf59ac1 100644 --- a/tests/integration/rules/floatType.phpt +++ b/tests/integration/rules/floatType.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::floatType())->assert(2.0)); --EXPECT-- "42.33" must be of type float `INF` must not be of type float -- `TRUE` must be of type float +- `true` must be of type float - 2.0 must not be of type float diff --git a/tests/integration/rules/image.phpt b/tests/integration/rules/image.phpt index 439ba8922..a1e4fa6ca 100644 --- a/tests/integration/rules/image.phpt +++ b/tests/integration/rules/image.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::image())->assert('tests/fixtures/v --EXPECT-- "tests/fixtures/invalid-image.png" must be a valid image "tests/fixtures/valid-image.png" must not be a valid image -- `[object] (stdClass: { })` must be a valid image +- `stdClass {}` must be a valid image - "tests/fixtures/valid-image.gif" must not be a valid image diff --git a/tests/integration/rules/imei.phpt b/tests/integration/rules/imei.phpt index 2c28cd023..c39eb41fe 100644 --- a/tests/integration/rules/imei.phpt +++ b/tests/integration/rules/imei.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::imei())->assert('356938035643809') --EXPECT-- "490154203237512" must be a valid IMEI "350077523237513" must not be a valid IMEI -- `NULL` must be a valid IMEI +- `null` must be a valid IMEI - "356938035643809" must not be a valid IMEI diff --git a/tests/integration/rules/in.phpt b/tests/integration/rules/in.phpt index 4b620e1d6..a67cb54b6 100644 --- a/tests/integration/rules/in.phpt +++ b/tests/integration/rules/in.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::in([2, '1', 3], true)->assert('2')); exceptionFullMessage(static fn() => v::not(v::in([2, '1', 3], true))->assert('1')); ?> --EXPECT-- -1 must be in `{ 3, 2 }` +1 must be in `[3, 2]` "foo" must not be in "foobar" -- "2" must be in `{ 2, "1", 3 }` -- "1" must not be in `{ 2, "1", 3 }` +- "2" must be in `[2, "1", 3]` +- "1" must not be in `[2, "1", 3]` diff --git a/tests/integration/rules/infinite.phpt b/tests/integration/rules/infinite.phpt index 2c825d8ce..453dc641e 100644 --- a/tests/integration/rules/infinite.phpt +++ b/tests/integration/rules/infinite.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::infinite())->assert(INF * -1)); --EXPECT-- -9 must be an infinite number `INF` must not be an infinite number -- `[object] (stdClass: { })` must be an infinite number +- `stdClass {}` must be an infinite number - `-INF` must not be an infinite number diff --git a/tests/integration/rules/instance.phpt b/tests/integration/rules/instance.phpt index 78f45be2d..f2b6fa0a0 100644 --- a/tests/integration/rules/instance.phpt +++ b/tests/integration/rules/instance.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::instance(ArrayIterator::class)->assert(ne exceptionFullMessage(static fn() => v::not(v::instance(stdClass::class))->assert(new stdClass())); ?> --EXPECT-- -"" must be an instance of "DateTime" -`[traversable] (ArrayObject: { })` must not be an instance of "Traversable" -- `[object] (stdClass: { })` must be an instance of "ArrayIterator" -- `[object] (stdClass: { })` must not be an instance of "stdClass" +"" must be an instance of `DateTime` +`ArrayObject { getArrayCopy() => [] }` must not be an instance of `Traversable` +- `stdClass {}` must be an instance of `ArrayIterator` +- `stdClass {}` must not be an instance of `stdClass` diff --git a/tests/integration/rules/intType.phpt b/tests/integration/rules/intType.phpt index fff5923f4..efa9687ef 100644 --- a/tests/integration/rules/intType.phpt +++ b/tests/integration/rules/intType.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::intType()->assert(INF)); exceptionFullMessage(static fn() => v::not(v::intType())->assert(1234567890)); ?> --EXPECT-- -`[object] (stdClass: { })` must be of type integer +`stdClass {}` must be of type integer 42 must not be of type integer - `INF` must be of type integer - 1234567890 must not be of type integer diff --git a/tests/integration/rules/iterableType.phpt b/tests/integration/rules/iterableType.phpt index 83a925f8c..363f444f7 100644 --- a/tests/integration/rules/iterableType.phpt +++ b/tests/integration/rules/iterableType.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::iterableType())->assert(new stdCla ?> --EXPECT-- 3 must be iterable -`{ 2, 3 }` must not be iterable +`[2, 3]` must not be iterable - "String" must be iterable -- `[object] (stdClass: { })` must not be iterable +- `stdClass {}` must not be iterable diff --git a/tests/integration/rules/json.phpt b/tests/integration/rules/json.phpt index 4e2a943e2..22b1460b9 100644 --- a/tests/integration/rules/json.phpt +++ b/tests/integration/rules/json.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::json()->assert(new stdClass())); exceptionFullMessage(static fn() => v::not(v::json())->assert('{}')); ?> --EXPECT-- -`FALSE` must be a valid JSON string +`false` must be a valid JSON string "{\"foo\": \"bar\", \"number\":1}" must not be a valid JSON string -- `[object] (stdClass: { })` must be a valid JSON string +- `stdClass {}` must be a valid JSON string - "{}" must not be a valid JSON string diff --git a/tests/integration/rules/languageCode.phpt b/tests/integration/rules/languageCode.phpt index 74099b8e5..19c68a1c1 100644 --- a/tests/integration/rules/languageCode.phpt +++ b/tests/integration/rules/languageCode.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::languageCode()->assert('por')); exceptionFullMessage(static fn() => v::not(v::languageCode())->assert('en')); ?> --EXPECT-- -`NULL` must be a valid ISO 639 "alpha-2" language code +`null` must be a valid ISO 639 "alpha-2" language code "pt" must not be a valid ISO 639 "alpha-2" language code - "por" must be a valid ISO 639 "alpha-2" language code - "en" must not be a valid ISO 639 "alpha-2" language code diff --git a/tests/integration/rules/notBlank.phpt b/tests/integration/rules/notBlank.phpt index 42be67bac..1656bb02d 100644 --- a/tests/integration/rules/notBlank.phpt +++ b/tests/integration/rules/notBlank.phpt @@ -22,4 +22,4 @@ Field must not be blank 1 must be blank - The value must not be blank - Field must not be blank -- `{ 1 }` must be blank +- `[1]` must be blank diff --git a/tests/integration/rules/notEmpty.phpt b/tests/integration/rules/notEmpty.phpt index 7a2538c11..84a05c742 100644 --- a/tests/integration/rules/notEmpty.phpt +++ b/tests/integration/rules/notEmpty.phpt @@ -23,4 +23,4 @@ Field must not be empty 1 must be empty - The value must not be empty - Field must not be empty -- `{ 1 }` must be empty +- `[1]` must be empty diff --git a/tests/integration/rules/nullType.phpt b/tests/integration/rules/nullType.phpt index 38b6b095a..c2af0e54a 100644 --- a/tests/integration/rules/nullType.phpt +++ b/tests/integration/rules/nullType.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::nullType())->assert(null)); ?> --EXPECT-- "" must be null -`NULL` must not be null -- `FALSE` must be null -- `NULL` must not be null +`null` must not be null +- `false` must be null +- `null` must not be null diff --git a/tests/integration/rules/objectType.phpt b/tests/integration/rules/objectType.phpt index 0fe687cde..a80120e61 100644 --- a/tests/integration/rules/objectType.phpt +++ b/tests/integration/rules/objectType.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::objectType()->assert('test')); exceptionFullMessage(static fn() => v::not(v::objectType())->assert(new ArrayObject())); ?> --EXPECT-- -`{ }` must be of type object -`[object] (stdClass: { })` must not be of type object +`[]` must be of type object +`stdClass {}` must not be of type object - "test" must be of type object -- `[traversable] (ArrayObject: { })` must not be of type object +- `ArrayObject { getArrayCopy() => [] }` must not be of type object diff --git a/tests/integration/rules/readable.phpt b/tests/integration/rules/readable.phpt index f3b1c9a52..0936a069f 100644 --- a/tests/integration/rules/readable.phpt +++ b/tests/integration/rules/readable.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::readable())->assert('tests/fixture --EXPECT-- "tests/fixtures/invalid-image.jpg" must be readable "tests/fixtures/valid-image.png" must not be readable -- `[object] (stdClass: { })` must be readable +- `stdClass {}` must be readable - "tests/fixtures/valid-image.png" must not be readable diff --git a/tests/integration/rules/regex.phpt b/tests/integration/rules/regex.phpt index dc1cd5c32..ff9471635 100644 --- a/tests/integration/rules/regex.phpt +++ b/tests/integration/rules/regex.phpt @@ -15,5 +15,5 @@ exceptionFullMessage(static fn() => v::not(v::regex('/^[a-z]+$/i'))->assert('wPo --EXPECT-- "w poiur" must validate against "/^w+$/" "wpoiur" must not validate against "/^[a-z]+$/" -- `[object] (stdClass: { })` must validate against "/^w+$/" +- `stdClass {}` must validate against "/^w+$/" - "wPoiur" must not validate against "/^[a-z]+$/i" diff --git a/tests/integration/rules/resourceType.phpt b/tests/integration/rules/resourceType.phpt index 809514e37..663b69cb3 100644 --- a/tests/integration/rules/resourceType.phpt +++ b/tests/integration/rules/resourceType.phpt @@ -16,6 +16,6 @@ exceptionFullMessage(static fn() => v::not(v::resourceType())->assert(tmpfile()) ?> --EXPECT-- "test" must be a resource -`[resource] (stream)` must not be a resource -- `{ }` must be a resource -- `[resource] (stream)` must not be a resource +`resource ` must not be a resource +- `[]` must be a resource +- `resource ` must not be a resource diff --git a/tests/integration/rules/scalarVal.phpt b/tests/integration/rules/scalarVal.phpt index 257fdfe50..bf6debdeb 100644 --- a/tests/integration/rules/scalarVal.phpt +++ b/tests/integration/rules/scalarVal.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::scalarVal()->assert(new stdClass())); exceptionFullMessage(static fn() => v::not(v::scalarVal())->assert(42)); ?> --EXPECT-- -`{ }` must be a scalar value -`TRUE` must not be a scalar value -- `[object] (stdClass: { })` must be a scalar value +`[]` must be a scalar value +`true` must not be a scalar value +- `stdClass {}` must be a scalar value - 42 must not be a scalar value diff --git a/tests/integration/rules/sorted.phpt b/tests/integration/rules/sorted.phpt index 50d2800b4..fa3ad86da 100644 --- a/tests/integration/rules/sorted.phpt +++ b/tests/integration/rules/sorted.phpt @@ -20,11 +20,11 @@ exceptionFullMessage(static fn() => v::not(v::sorted('ASC'))->assert([1, 2, 3])) exceptionFullMessage(static fn() => v::not(v::sorted('DESC'))->assert([3, 2, 1])); ?> --EXPECT-- -`{ 1, 3, 2 }` must be sorted in ascending order -`{ 1, 2, 3 }` must be sorted in descending order -`{ 1, 2, 3 }` must not be sorted in ascending order -`{ 3, 2, 1 }` must not be sorted in descending order -- `{ 3, 2, 1 }` must be sorted in ascending order -- `{ 1, 2, 3 }` must be sorted in descending order -- `{ 1, 2, 3 }` must not be sorted in ascending order -- `{ 3, 2, 1 }` must not be sorted in descending order +`[1, 3, 2]` must be sorted in ascending order +`[1, 2, 3]` must be sorted in descending order +`[1, 2, 3]` must not be sorted in ascending order +`[3, 2, 1]` must not be sorted in descending order +- `[3, 2, 1]` must be sorted in ascending order +- `[1, 2, 3]` must be sorted in descending order +- `[1, 2, 3]` must not be sorted in ascending order +- `[3, 2, 1]` must not be sorted in descending order diff --git a/tests/integration/rules/startsWith.phpt b/tests/integration/rules/startsWith.phpt index 5f8980845..f97c83ede 100644 --- a/tests/integration/rules/startsWith.phpt +++ b/tests/integration/rules/startsWith.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::startsWith('3.3', true)->assert([3.3, 4.4 exceptionFullMessage(static fn() => v::not(v::startsWith('c'))->assert(['c', 'd'])); ?> --EXPECT-- -`{ "a", "b" }` must start with "b" -`{ 1.1, 2.2 }` must not start with 1.1 -- `{ 3.3, 4.4 }` must start with "3.3" -- `{ "c", "d" }` must not start with "c" +`["a", "b"]` must start with "b" +`[1.1, 2.2]` must not start with 1.1 +- `[3.3, 4.4]` must start with "3.3" +- `["c", "d"]` must not start with "c" diff --git a/tests/integration/rules/stringType.phpt b/tests/integration/rules/stringType.phpt index 41cd6317f..e2363e040 100644 --- a/tests/integration/rules/stringType.phpt +++ b/tests/integration/rules/stringType.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::stringType())->assert('bar')); --EXPECT-- 42 must be of type string "foo" must not be of type string -- `TRUE` must be of type string +- `true` must be of type string - "bar" must not be of type string diff --git a/tests/integration/rules/stringVal.phpt b/tests/integration/rules/stringVal.phpt index a1b53277b..54c21dfd6 100644 --- a/tests/integration/rules/stringVal.phpt +++ b/tests/integration/rules/stringVal.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::stringVal()->assert(new stdClass())); exceptionFullMessage(static fn() => v::not(v::stringVal())->assert(42)); ?> --EXPECT-- -`{ }` must be a string -`TRUE` must not be string -- `[object] (stdClass: { })` must be a string +`[]` must be a string +`true` must not be string +- `stdClass {}` must be a string - 42 must not be string diff --git a/tests/integration/rules/subset.phpt b/tests/integration/rules/subset.phpt index f85e1e0da..80f490c8c 100644 --- a/tests/integration/rules/subset.phpt +++ b/tests/integration/rules/subset.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::subset(['A', 'B'])->assert(['B', 'C'])); exceptionFullMessage(static fn() => v::not(v::subset(['A']))->assert(['A'])); ?> --EXPECT-- -`{ 1, 2, 3 }` must be subset of `{ 1, 2 }` -`{ 1, 2 }` must not be subset of `{ 1, 2, 3 }` -- `{ "B", "C" }` must be subset of `{ "A", "B" }` -- `{ "A" }` must not be subset of `{ "A" }` +`[1, 2, 3]` must be subset of `[1, 2]` +`[1, 2]` must not be subset of `[1, 2, 3]` +- `["B", "C"]` must be subset of `["A", "B"]` +- `["A"]` must not be subset of `["A"]` diff --git a/tests/integration/rules/trueVal.phpt b/tests/integration/rules/trueVal.phpt index 1a73c185e..15af104a6 100644 --- a/tests/integration/rules/trueVal.phpt +++ b/tests/integration/rules/trueVal.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::trueVal()->assert(0)); exceptionFullMessage(static fn() => v::not(v::trueVal())->assert('true')); ?> --EXPECT-- -`FALSE` must evaluate to `true` +`false` must evaluate to `true` 1 must not evaluate to `true` - 0 must evaluate to `true` - "true" must not evaluate to `true` diff --git a/tests/integration/rules/type.phpt b/tests/integration/rules/type.phpt index 8f936ccef..e431e7c62 100644 --- a/tests/integration/rules/type.phpt +++ b/tests/integration/rules/type.phpt @@ -18,4 +18,4 @@ exceptionFullMessage(static fn() => v::not(v::type('bool'))->assert(true)); "42" must be "integer" "foo" must not be "string" - 20 must be "double" -- `TRUE` must not be "bool" +- `true` must not be "bool" diff --git a/tests/integration/rules/unique.phpt b/tests/integration/rules/unique.phpt index e66c6fb74..315fb73e9 100644 --- a/tests/integration/rules/unique.phpt +++ b/tests/integration/rules/unique.phpt @@ -15,7 +15,7 @@ exceptionFullMessage(static fn() => v::unique()->assert('test')); exceptionFullMessage(static fn() => v::not(v::unique())->assert(['a', 'b', 'c'])); ?> --EXPECT-- -`{ 1, 2, 2, 3 }` must not contain duplicates -`{ 1, 2, 3, 4 }` must contain duplicates +`[1, 2, 2, 3]` must not contain duplicates +`[1, 2, 3, 4]` must contain duplicates - "test" must not contain duplicates -- `{ "a", "b", "c" }` must contain duplicates +- `["a", "b", "c"]` must contain duplicates diff --git a/tests/integration/rules/writable.phpt b/tests/integration/rules/writable.phpt index 3a8e0e058..81bc4b912 100644 --- a/tests/integration/rules/writable.phpt +++ b/tests/integration/rules/writable.phpt @@ -17,5 +17,5 @@ exceptionFullMessage(static fn() => v::not(v::writable())->assert('tests/fixture --EXPECT-- "/path/of/a/valid/writable/file.txt" must be writable "tests/fixtures/valid-image.png" must not be writable -- `{ }` must be writable +- `[]` must be writable - "tests/fixtures/invalid-image.png" must not be writable diff --git a/tests/unit/Rules/KeySetTest.php b/tests/unit/Rules/KeySetTest.php index f73221817..8b1f6d643 100644 --- a/tests/unit/Rules/KeySetTest.php +++ b/tests/unit/Rules/KeySetTest.php @@ -148,7 +148,7 @@ public function shouldCheckKeys(): void $keySet = new KeySet($key1, $key2); $this->expectException(KeySetException::class); - $this->expectExceptionMessage('Must have keys `{ "foo", "bar" }`'); + $this->expectExceptionMessage('Must have keys `["foo", "bar"]`'); $keySet->check($input); } @@ -166,7 +166,7 @@ public function shouldAssertKeys(): void $keySet = new KeySet($key1, $key2); $this->expectException(KeySetException::class); - $this->expectExceptionMessage('Must have keys `{ "foo", "bar" }`'); + $this->expectExceptionMessage('Must have keys `["foo", "bar"]`'); $keySet->assert($input); } @@ -183,7 +183,7 @@ public function shouldWarnOfExtraKeysWithMessage(): void $keySet = new KeySet($key1); $this->expectException(KeySetException::class); - $this->expectExceptionMessage('Must not have keys `{ "bar" }`'); + $this->expectExceptionMessage('Must not have keys `["bar"]`'); $keySet->assert($input); } @@ -213,7 +213,7 @@ public function shouldThrowExceptionInCaseArgumentIsAnythingOtherThanArray($inpu $keySet = new KeySet(new Key('name')); $this->expectException(KeySetException::class); - $this->expectExceptionMessage('Must have keys `{ "name" }`'); + $this->expectExceptionMessage('Must have keys `["name"]`'); $keySet->assert($input); }