Skip to content

Commit 536d3d9

Browse files
committed
Add test for required property
1 parent 14cadd2 commit 536d3d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/Constraints/DefaultPropertiesTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function getValidTests()
3333
'{"properties":{"propertyTwo":{"default":"valueTwo"}}}',
3434
'{"propertyOne":"valueOne","propertyTwo":"valueTwo"}'
3535
),
36+
array(// fulfil required property with a default value
37+
'{"propertyOne":"valueOne"}',
38+
'{"properties":{"propertyTwo":{"required":true,"default":"valueTwo"}}}',
39+
'{"propertyOne":"valueOne","propertyTwo":"valueTwo"}'
40+
),
3641
array(// default value for sub-property
3742
'{"propertyOne":{}}',
3843
'{"properties":{"propertyOne":{"properties":{"propertyTwo":{"default":"valueTwo"}}}}}',

0 commit comments

Comments
 (0)