Skip to content

Commit 28de366

Browse files
committed
Add unit tests.
1 parent 34ca930 commit 28de366

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

tests/JsonSchema/Tests/Constraints/AdditionalPropertiesTest.php

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,29 @@ public function getInvalidTests()
8080
"additionalProperties": {"type":"string"}
8181
}',
8282
Validator::CHECK_MODE_TYPE_CAST
83-
)
83+
),
84+
array(
85+
'{
86+
"prop1": "a",
87+
"prop2": "b"
88+
}',
89+
'{
90+
"type": "object",
91+
"additionalProperties": {
92+
"type": "boolean"
93+
}
94+
}'
95+
),
96+
array(
97+
'{
98+
"prop1": "a",
99+
"prop2": "b"
100+
}',
101+
'{
102+
"type": "object",
103+
"additionalProperties": false
104+
}'
105+
),
84106
);
85107
}
86108

@@ -137,7 +159,29 @@ public function getValidTests()
137159
},
138160
"additionalProperties": true
139161
}'
140-
)
162+
),
163+
array(
164+
'{
165+
"prop1": "a",
166+
"prop2": "b"
167+
}',
168+
'{
169+
"type": "object",
170+
"additionalProperties": {
171+
"type": "string"
172+
}
173+
}'
174+
),
175+
array(
176+
'{
177+
"prop1": "a",
178+
"prop2": "b"
179+
}',
180+
'{
181+
"type": "object",
182+
"additionalProperties": true
183+
}'
184+
),
141185
);
142186
}
143187
}

0 commit comments

Comments
 (0)