Skip to content

Commit

Permalink
Added a regression test for jsonrainbow#215.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtucek committed Feb 1, 2016
1 parent 05933b2 commit 16fab63
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions tests/JsonSchema/Tests/Constraints/MinItemsMaxItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}'
)
);
}
Expand Down

0 comments on commit 16fab63

Please sign in to comment.