Skip to content

Commit

Permalink
add unit tests to validate issue jsonrainbow#102
Browse files Browse the repository at this point in the history
(cherry picked from commit 3140166)
  • Loading branch information
alexmmm committed May 5, 2014
1 parent d97cf3c commit 7a3b697
Showing 1 changed file with 68 additions and 2 deletions.
70 changes: 68 additions & 2 deletions tests/JsonSchema/Tests/Constraints/RequiredPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,40 @@ public function getInvalidTests()
"null":{"type":"null", "required": true}
}
}'
)
),
array(
'{
"foo": {"baz": 1.5}
}',
'{
"type": "object",
"properties": {
"foo": {
"type": "object",
"properties": {
"bar": {"type": "number"}
},
"required": ["bar"]
}
}
}'
),
array(
'{
"foo": {"baz": 1.5}
}',
'{
"type": "object",
"properties": {
"foo": {
"type": "object",
"properties": {
"bar": {"type": "number", "required": true}
}
}
}
}'
),
);
}

Expand Down Expand Up @@ -266,7 +299,40 @@ public function getValidTests()
"foo": { "required": true }
}
}'
)
),
array(
'{
"boo": {"bar": 1.5}
}',
'{
"type": "object",
"properties": {
"foo": {
"type": "object",
"properties": {
"bar": {"type": "number"}
},
"required": ["bar"]
}
}
}'
),
array(
'{
"boo": {"bar": 1.5}
}',
'{
"type": "object",
"properties": {
"foo": {
"type": "object",
"properties": {
"bar": {"type": "number", "required": true}
}
}
}
}'
),
);
}
}

0 comments on commit 7a3b697

Please sign in to comment.