Skip to content

Commit a9edae1

Browse files
committed
Adding a couple tests for jsonrainbow#4
1 parent 40d20e3 commit a9edae1

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/JsonSchema/Tests/Constraints/NumberAndIntegerTypesTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ public function getValidTests()
5252
"number":{"type":"number"}
5353
}
5454
}'
55+
),
56+
array(
57+
'{
58+
"number": "1.4"
59+
}',
60+
'{
61+
"type":"object",
62+
"properties":{
63+
"number":{"type":"number"}
64+
}
65+
}'
5566
)
5667
);
5768
}

tests/JsonSchema/Tests/Constraints/PhpTypeCastModeTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ public function getValidTests()
7575
}',
7676
Validator::CHECK_MODE_TYPE_CAST
7777
),
78+
array(
79+
'{
80+
"a":"1.337"
81+
}',
82+
'{
83+
"type":"object",
84+
"properties":{
85+
"a":{"type":"number","maximum":8.0}
86+
}
87+
}',
88+
Validator::CHECK_MODE_TYPE_CAST
89+
),
7890
array(
7991
'{
8092
"a":"9e42"

0 commit comments

Comments
 (0)