Skip to content

Commit f398722

Browse files
alexmmmsiwinski
authored andcommitted
add unit tests to validate issue jsonrainbow#76
1 parent 18c5ba1 commit f398722

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

tests/JsonSchema/Tests/Constraints/OfPropertiesTest.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ public function getInvalidTests()
8888
),
8989
),
9090
),
91+
array(
92+
'{"prop1": [1,2]}',
93+
'{
94+
"type": "object",
95+
"properties": {
96+
"prop1": {
97+
"oneOf": [
98+
{
99+
"type": "string",
100+
"pattern": "^[a-z]*$"
101+
},
102+
{
103+
"type": "string",
104+
"pattern": "^[A-Z]*$"
105+
}
106+
]
107+
}
108+
}
109+
}'
110+
),
91111
array(
92112
'{"prop1": [1,2]}',
93113
'{
@@ -173,12 +193,10 @@ public function getInvalidTests()
173193
"type": "number"
174194
},
175195
{
176-
"type": "string",
177-
"pattern": "^[a-z]*$"
196+
"type": "string"
178197
},
179198
{
180-
"type": "string",
181-
"pattern": "^[A-Z]*$"
199+
"type": "string"
182200
}
183201
]
184202
}

0 commit comments

Comments
 (0)