@@ -19,7 +19,7 @@ class MinMaxPropertiesTest extends BaseTestCase
19
19
public function getValidTests (): array
20
20
{
21
21
return [
22
- [
22
+ ' Empty object with minProperties: 0 ' => [
23
23
'{
24
24
"value": {}
25
25
} ' ,
@@ -30,7 +30,7 @@ public function getValidTests(): array
30
30
}
31
31
} '
32
32
],
33
- [
33
+ ' Empty object with maxProperties: 1 ' => [
34
34
'{
35
35
"value": {}
36
36
} ' ,
@@ -41,7 +41,7 @@ public function getValidTests(): array
41
41
}
42
42
} '
43
43
],
44
- [
44
+ ' Empty object with minProperties: 0 and maxProperties: 1 ' => [
45
45
'{
46
46
"value": {}
47
47
} ' ,
@@ -52,7 +52,7 @@ public function getValidTests(): array
52
52
}
53
53
} '
54
54
],
55
- [
55
+ ' Object with two properties with minProperties: 1 and maxProperties: 2 ' => [
56
56
'{
57
57
"value": {"foo": 1, "bar": 2}
58
58
} ' ,
@@ -63,6 +63,26 @@ public function getValidTests(): array
63
63
}
64
64
} '
65
65
],
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
+ ],
66
86
];
67
87
}
68
88
@@ -72,7 +92,7 @@ public function getValidTests(): array
72
92
public function getInvalidTests (): array
73
93
{
74
94
return [
75
- [
95
+ ' Empty object with minProperties: 1 ' => [
76
96
'{
77
97
"value": {}
78
98
} ' ,
@@ -83,7 +103,7 @@ public function getInvalidTests(): array
83
103
}
84
104
} '
85
105
],
86
- [
106
+ ' Empty object with minProperties ' => [
87
107
'{} ' ,
88
108
'{
89
109
"type": "object",
@@ -98,7 +118,7 @@ public function getInvalidTests(): array
98
118
"minProperties": 1
99
119
} '
100
120
],
101
- [
121
+ ' Object with two properties with maxProperties: 1 ' => [
102
122
'{
103
123
"value": {
104
124
"propertyOne": "valueOne",
@@ -112,7 +132,7 @@ public function getInvalidTests(): array
112
132
}
113
133
} '
114
134
],
115
- [
135
+ ' Object with two properties with minProperties: 1 and maxProperties: 2 ' => [
116
136
'{
117
137
"value": {"foo": 1, "bar": 2, "baz": 3}
118
138
} ' ,
@@ -123,16 +143,6 @@ public function getInvalidTests(): array
123
143
}
124
144
} '
125
145
],
126
- [
127
- '{
128
- "value": []
129
- } ' ,
130
- '{
131
- "properties": {
132
- "value": {"minProperties": 1,"maxProperties": 2}
133
- }
134
- } '
135
- ],
136
146
];
137
147
}
138
148
}
0 commit comments