diff --git a/tests/JsonSchema/Tests/Constraints/MinItemsMaxItemsTest.php b/tests/JsonSchema/Tests/Constraints/MinItemsMaxItemsTest.php index 1b477845..d40f6701 100644 --- a/tests/JsonSchema/Tests/Constraints/MinItemsMaxItemsTest.php +++ b/tests/JsonSchema/Tests/Constraints/MinItemsMaxItemsTest.php @@ -63,6 +63,98 @@ public function getValidTests() "value":{"type":"array","minItems":2,"maxItems":4} } }' + ), + // Regression test for issue 215 + array( + '{ + "campaign": 1, + "offset": 0, + "service_provider": 3, + "include_hotel": false, + "arrival": "2016-01-20", + "departure": "2016-01-27", + "session": "foobar", + "ip": "127.0.0.1", + "language_iso_code": "de", + "travellers": [ + 18, + 18, + 18 + ] + }', + '{ + "type": "object", + "additionalProperties": false, + "required": [ + "session", + "include_hotel", + "arrival", + "departure", + "ip", + "travellers", + "language_iso_code" + ], + "properties": { + "session": { + "type": "string" + }, + "campaign": { + "type": "integer" + }, + "service_provider": { + "type": "integer" + }, + "include_hotel": { + "type": "boolean" + }, + "arrival": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "departure": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "ip": { + "type": "string" + }, + "offerId": { + "type": "integer", + "minimum": 1 + }, + "quiet": { + "type": "boolean" + }, + "language_iso_code": { + "type": "string" + }, + "travellers": { + "type": "array", + "minItems": 1, + "maxItems": 16, + "items": { + "type": "integer" + } + }, + "rooms": { + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "maxProperties": 2, + "properties": { + "size_1": { + "type": "number" + }, + "size_2": { + "type": "number" + } + } + }, + "offset": { + "type": "integer" + } + } + }' ) ); }