@@ -532,6 +532,23 @@ function (int $input, int $fieldOneValue) : int {
532532 [],
533533 ],
534534 ],
535+ 'uuid ' => [
536+ 'spec ' => [
537+ 'field ' => [['uuid ' , false , false , [4 ]]],
538+ ],
539+ 'input ' => [
540+ 'field ' => '2c02b87a-97ec-4de0-8c50-6721a29c150f ' ,
541+ ],
542+ 'options ' => [],
543+ 'result ' => [
544+ true ,
545+ [
546+ 'field ' => '2c02b87a-97ec-4de0-8c50-6721a29c150f ' ,
547+ ],
548+ null ,
549+ [],
550+ ],
551+ ],
535552 ];
536553 }
537554
@@ -899,17 +916,18 @@ public function ofScalarsWithMeaninglessKeys()
899916 */
900917 public function ofScalarsFail ()
901918 {
919+ $ valueOne = '1 ' ;
920+ $ valueTwo = [];
921+ $ valueThree = new stdClass ();
902922 try {
903- Filterer::ofScalars ([' 1 ' , [], new stdClass ], [['string ' ]]);
923+ Filterer::ofScalars ([$ valueOne , $ valueTwo , $ valueThree ], [['string ' ]]);
904924 $ this ->fail ();
905925 } catch (FilterException $ e ) {
926+ $ valueTwoExport = var_export ($ valueTwo , true );
927+ $ valueThreeExport = var_export ($ valueThree , true );
906928 $ expected = <<<TXT
907- Field '1' with value 'array (
908- )' failed filtering, message 'Value 'array (
909- )' is not a string'
910- Field '2' with value 'stdClass::__set_state(array(
911- ))' failed filtering, message 'Value 'stdClass::__set_state(array(
912- ))' is not a string'
929+ Field '1' with value ' {$ valueTwoExport }' failed filtering, message 'Value ' {$ valueTwoExport }' is not a string'
930+ Field '2' with value ' {$ valueThreeExport }' failed filtering, message 'Value ' {$ valueThreeExport }' is not a string'
913931TXT ;
914932 $ this ->assertSame ($ expected , $ e ->getMessage ());
915933 }
@@ -957,20 +975,22 @@ public function ofArraysRequiredAndUnknown()
957975 */
958976 public function ofArraysFail ()
959977 {
978+ $ valueOne = new stdClass ();
979+ $ valueTwo = [];
980+ $ valueThree = null ;
981+ $ valueFour = 'key ' ;
960982 try {
961983 Filterer::ofArrays (
962- [['key ' => new stdClass ], ['key ' => []] , ['key ' => null ], ' key ' ],
984+ [['key ' => $ valueOne ], ['key ' => $ valueTwo ] , ['key ' => $ valueThree ], $ valueFour ],
963985 ['key ' => [['string ' ]]]
964986 );
965987 $ this ->fail ();
966988 } catch (FilterException $ e ) {
989+ $ valueOneExport = var_export ($ valueOne , true );
990+ $ valueTwoExport = var_export ($ valueTwo , true );
967991 $ expected = <<<TXT
968- Field 'key' with value 'stdClass::__set_state(array(
969- ))' failed filtering, message 'Value 'stdClass::__set_state(array(
970- ))' is not a string'
971- Field 'key' with value 'array (
972- )' failed filtering, message 'Value 'array (
973- )' is not a string'
992+ Field 'key' with value ' {$ valueOneExport }' failed filtering, message 'Value ' {$ valueOneExport }' is not a string'
993+ Field 'key' with value ' {$ valueTwoExport }' failed filtering, message 'Value ' {$ valueTwoExport }' is not a string'
974994Field 'key' with value 'NULL' failed filtering, message 'Value failed filtering, \$allowNull is set to false'
975995Value at position '3' was not an array
976996TXT ;
0 commit comments