@@ -70,6 +70,8 @@ public function testValidCoerceCases($input, $schema, $errors = array())
7070        $ this assertTrue (gettype ($ valuenullArray ) == 'NULL ' );
7171        $ this assertTrue (gettype ($ valuedoubleCoercion ) == 'array ' );
7272        $ this assertTrue (gettype ($ valuedoubleCoercion2 ) == 'integer ' );
73+         $ this assertTrue (gettype ($ valuedoubleCoercion3 ) == 'integer ' );
74+         $ this assertTrue (gettype ($ valuedoubleCoercion4 ) == 'integer ' );
7375
7476        $ validatorvalidate ($ value$ schema$ checkMode
7577
@@ -95,6 +97,8 @@ public function testValidCoerceCases($input, $schema, $errors = array())
9597        $ this assertTrue (gettype ($ valuenullArray ) == 'array ' );
9698        $ this assertTrue (gettype ($ valuedoubleCoercion ) == 'integer ' );
9799        $ this assertTrue (gettype ($ valuedoubleCoercion2 ) == 'array ' );
100+         $ this assertTrue (gettype ($ valuedoubleCoercion3 ) == 'array ' );
101+         $ this assertTrue (gettype ($ valuedoubleCoercion4 ) == 'string ' );
98102
99103        $ this assertTrue (gettype ($ valuemultitype1 ) == 'boolean ' );
100104        $ this assertTrue (gettype ($ valuemultitype2 ) == 'double ' );
@@ -123,6 +127,8 @@ public function testValidCoerceCases($input, $schema, $errors = array())
123127        $ this assertTrue ($ valuenullArray  === array (null ));
124128        $ this assertTrue ($ valuedoubleCoercion  === 45 );
125129        $ this assertTrue ($ valuedoubleCoercion2  === array ('45 ' ));
130+         $ this assertTrue ($ valuedoubleCoercion3  === array ('45 ' ));
131+         $ this assertTrue ($ valuedoubleCoercion4  === '45 ' );
126132
127133        $ this assertTrue ($ validatorisValid (), print_r ($ validatorgetErrors (), true ));
128134    }
@@ -195,6 +201,8 @@ public function getValidCoerceTests()
195201                  "nullArray":null, 
196202                  "doubleCoercion":["45"], 
197203                  "doubleCoercion2":45, 
204+                   "doubleCoercion3":45, 
205+                   "doubleCoercion4":45, 
198206                  "null":null, 
199207                  "any": "string", 
200208                  "allOf": "1", 
@@ -237,6 +245,8 @@ public function getValidCoerceTests()
237245                    "nullArray":{"type":"array"}, 
238246                    "doubleCoercion":{"type":"number"}, 
239247                    "doubleCoercion2":{"type":"array","items":[{"type":"string"}]}, 
248+                     "doubleCoercion3":{"anyOf":[{"type":"array","items":[{"type":"string"}]},{"type":"number"}]}, 
249+                     "doubleCoercion4":{"anyOf":[{"type":"array","items":[{"type":"object"}]},{"type":"string"}]}, 
240250                    "null":{"type":"null"}, 
241251                    "any": {"type":"any"}, 
242252                    "allOf" : {"allOf":[{ 
0 commit comments