Skip to content
This repository
Browse code

Add test cases for optional enums

Added test cases where required is set as true and false,
with the attribute omitted.
  • Loading branch information...
commit 5c4cf3dbc3a2807228564366ec1468cb58ddd92d 1 parent 78cbf74
Joakim Löfgren JoakimLofgren authored

Showing 1 changed file with 38 additions and 0 deletions. Show diff stats Hide diff stats

  1. +38 0 tests/JsonSchema/Tests/Constraints/EnumTest.php
38 tests/JsonSchema/Tests/Constraints/EnumTest.php
@@ -25,6 +25,20 @@ public function getInvalidTests()
25 25 },
26 26 "additionalProperties":false
27 27 }'
  28 + ),
  29 + array(
  30 + '{}',
  31 + '{
  32 + "type":"object",
  33 + "properties":{
  34 + "value":{
  35 + "type":"string",
  36 + "enum":["Abacate","Manga","Pitanga"],
  37 + "required":true
  38 + }
  39 + },
  40 + "additionalProperties":false
  41 + }'
28 42 )
29 43 );
30 44 }
@@ -43,6 +57,30 @@ public function getValidTests()
43 57 },
44 58 "additionalProperties":false
45 59 }'
  60 + ),
  61 + array(
  62 + '{}',
  63 + '{
  64 + "type":"object",
  65 + "properties":{
  66 + "value":{"type":"string","enum":["Abacate","Manga","Pitanga"]}
  67 + },
  68 + "additionalProperties":false
  69 + }'
  70 + ),
  71 + array(
  72 + '{}',
  73 + '{
  74 + "type":"object",
  75 + "properties":{
  76 + "value":{
  77 + "type":"string",
  78 + "enum":["Abacate","Manga","Pitanga"],
  79 + "required":false
  80 + }
  81 + },
  82 + "additionalProperties":false
  83 + }'
46 84 )
47 85 );
48 86 }

0 comments on commit 5c4cf3d

Please sign in to comment.
Something went wrong with that request. Please try again.