@@ -19,7 +19,7 @@ class MinMaxPropertiesTest extends BaseTestCase
1919 public function getValidTests (): array
2020 {
2121 return [
22- [
22+ ' Empty object with minProperties: 0 ' => [
2323 '{
2424 "value": {}
2525 } ' ,
@@ -30,7 +30,7 @@ public function getValidTests(): array
3030 }
3131 } '
3232 ],
33- [
33+ ' Empty object with maxProperties: 1 ' => [
3434 '{
3535 "value": {}
3636 } ' ,
@@ -41,7 +41,7 @@ public function getValidTests(): array
4141 }
4242 } '
4343 ],
44- [
44+ ' Empty object with minProperties: 0 and maxProperties: 1 ' => [
4545 '{
4646 "value": {}
4747 } ' ,
@@ -52,7 +52,7 @@ public function getValidTests(): array
5252 }
5353 } '
5454 ],
55- [
55+ ' Object with two properties with minProperties: 1 and maxProperties: 2 ' => [
5656 '{
5757 "value": {"foo": 1, "bar": 2}
5858 } ' ,
@@ -63,6 +63,26 @@ public function getValidTests(): array
6363 }
6464 } '
6565 ],
66+ 'Empty array with minProperties: 1 and maxProperties: 2 ' => [
67+ '{
68+ "value": []
69+ } ' ,
70+ '{
71+ "properties": {
72+ "value": {"minProperties": 1,"maxProperties": 2}
73+ }
74+ } '
75+ ],
76+ 'Array with two items with maxProperties: 1 ' => [
77+ '{
78+ "value": [1, 2]
79+ } ' ,
80+ '{
81+ "properties": {
82+ "value": {""maxProperties": 1}
83+ }
84+ } '
85+ ],
6686 ];
6787 }
6888
@@ -72,7 +92,7 @@ public function getValidTests(): array
7292 public function getInvalidTests (): array
7393 {
7494 return [
75- [
95+ ' Empty object with minProperties: 1 ' => [
7696 '{
7797 "value": {}
7898 } ' ,
@@ -83,7 +103,7 @@ public function getInvalidTests(): array
83103 }
84104 } '
85105 ],
86- [
106+ ' Empty object with minProperties ' => [
87107 '{} ' ,
88108 '{
89109 "type": "object",
@@ -98,7 +118,7 @@ public function getInvalidTests(): array
98118 "minProperties": 1
99119 } '
100120 ],
101- [
121+ ' Object with two properties with maxProperties: 1 ' => [
102122 '{
103123 "value": {
104124 "propertyOne": "valueOne",
@@ -112,7 +132,7 @@ public function getInvalidTests(): array
112132 }
113133 } '
114134 ],
115- [
135+ ' Object with two properties with minProperties: 1 and maxProperties: 2 ' => [
116136 '{
117137 "value": {"foo": 1, "bar": 2, "baz": 3}
118138 } ' ,
@@ -123,16 +143,6 @@ public function getInvalidTests(): array
123143 }
124144 } '
125145 ],
126- [
127- '{
128- "value": []
129- } ' ,
130- '{
131- "properties": {
132- "value": {"minProperties": 1,"maxProperties": 2}
133- }
134- } '
135- ],
136146 ];
137147 }
138148}
0 commit comments