From e4721bf031de175b6404839af3d47eed09acca8b Mon Sep 17 00:00:00 2001 From: alexmmm Date: Tue, 16 Jul 2013 00:46:20 +0200 Subject: [PATCH] split composite invalid case into independent testcases - the composite case proved that one type check failed not all of them --- .../Tests/Constraints/BasicTypesTest.php | 86 ++++++++++++++++--- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/tests/JsonSchema/Tests/Constraints/BasicTypesTest.php b/tests/JsonSchema/Tests/Constraints/BasicTypesTest.php index c2552c8e..7daa43ad 100644 --- a/tests/JsonSchema/Tests/Constraints/BasicTypesTest.php +++ b/tests/JsonSchema/Tests/Constraints/BasicTypesTest.php @@ -16,23 +16,83 @@ public function getInvalidTests() return array( array( '{ - "string":null, - "number":null, - "integer":null, - "boolean":null, - "object":null, - "array":null, + "string":null + }', + '{ + "type":"object", + "properties": { + "string":{"type":"string"} + }, + "additionalProperties":false + }' + ), + array( + '{ + "number":null + }', + '{ + "type":"object", + "properties": { + "number":{"type":"number"} + }, + "additionalProperties":false + }' + ), + array( + '{ + "integer":null + }', + '{ + "type":"object", + "properties": { + "integer":{"type":"integer"} + }, + "additionalProperties":false + }' + ), + array( + '{ + "boolean":null + }', + '{ + "type":"object", + "properties": { + "boolean":{"type":"boolean"} + }, + "additionalProperties":false + }' + ), + array( + '{ + "object":null + }', + '{ + "type":"object", + "properties": { + "object":{"type":"object"} + }, + "additionalProperties":false + }' + ), + array( + '{ + "array":null + }', + '{ + "type":"object", + "properties": { + "array":{"type":"array"} + }, + "additionalProperties":false + }' + ), + array( + '{ "null":1 }', '{ "type":"object", - "properties":{ - "string":{"type":"string"}, - "number":{"type":"number"}, - "integer":{"type":"integer"}, - "boolean":{"type":"boolean"}, - "object":{"type":"object"}, - "array":{"type":"array"}, + "properties": { "null":{"type":"null"} }, "additionalProperties":false