File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,27 @@ public function dataCoerceCases()
144
144
'string ' , 'integer ' , 42 , true
145
145
);
146
146
147
+ // #48 check boolean coercion with "const"
148
+ $ tests [] = array (
149
+ '{"properties":{"propertyOne":{"type":"boolean","const":false}}} ' ,
150
+ '{"propertyOne":"false"} ' ,
151
+ 'string ' , 'boolean ' , false , true
152
+ );
153
+
154
+ // #49 check boolean coercion with "const"
155
+ $ tests [] = array (
156
+ '{"properties":{"propertyOne":{"type":"boolean","const":true}}} ' ,
157
+ '{"propertyOne":"true"} ' ,
158
+ 'string ' , 'boolean ' , true , true
159
+ );
160
+
161
+ // #50 check boolean coercion with "const"
162
+ $ tests [] = array (
163
+ '{"properties":{"propertyOne":{"type":"boolean","const":true}}} ' ,
164
+ '{"propertyOne":1} ' ,
165
+ 'integer ' , 'boolean ' , true , true
166
+ );
167
+
147
168
foreach ($ types as $ toType => $ testCases ) {
148
169
foreach ($ testCases as $ testCase ) {
149
170
$ tests [] = array (
You can’t perform that action at this time.
0 commit comments