Skip to content

Commit 2b5aab6

Browse files
committed
Fix constraints creation for tests
1 parent 68201f5 commit 2b5aab6

10 files changed

+287
-171
lines changed

features/03_comparaison-constraints/equalTo-constraints.feature

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ Feature: ConstraintToParamsDocTransformer - EqualTo & NotEqualTo constraint
4242
Given I have the following Constraint:
4343
"""
4444
use Symfony\Component\Validator\Constraints as ConstraintNS;
45-
return new ConstraintNS\EqualTo([
46-
'value' => 'expected-text',
47-
'payload' => [
45+
return new ConstraintNS\EqualTo(
46+
'expected-text',
47+
null,
48+
null,
49+
null,
50+
[
4851
'documentation' => [
4952
'description' => 'description',
5053
'default' => 'default',
@@ -53,7 +56,7 @@ Feature: ConstraintToParamsDocTransformer - EqualTo & NotEqualTo constraint
5356
'nullable' => false
5457
]
5558
]
56-
]);
59+
);
5760
"""
5861
When I transform constraint
5962
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\TypeDoc"
@@ -73,9 +76,12 @@ Feature: ConstraintToParamsDocTransformer - EqualTo & NotEqualTo constraint
7376
Given I have the following Constraint:
7477
"""
7578
use Symfony\Component\Validator\Constraints as ConstraintNS;
76-
return new ConstraintNS\NotEqualTo([
77-
'value' => 'expected-text',
78-
'payload' => [
79+
return new ConstraintNS\NotEqualTo(
80+
'expected-text',
81+
null,
82+
null,
83+
null,
84+
[
7985
'documentation' => [
8086
'description' => 'description',
8187
'default' => 'default',
@@ -84,7 +90,7 @@ Feature: ConstraintToParamsDocTransformer - EqualTo & NotEqualTo constraint
8490
'nullable' => false
8591
]
8692
]
87-
]);
93+
);
8894
"""
8995
When I transform constraint
9096
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\TypeDoc"

features/03_comparaison-constraints/greaterThan-constraints.feature

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
2121
Given I have the following Constraint:
2222
"""
2323
use Symfony\Component\Validator\Constraints as ConstraintNS;
24-
return new ConstraintNS\GreaterThan([
25-
'value' => 2,
26-
'payload' => [
24+
return new ConstraintNS\GreaterThan(
25+
2,
26+
null,
27+
null,
28+
null,
29+
[
2730
'documentation' => [
2831
'type' => 'integer'
2932
]
3033
]
31-
]);
34+
);
3235
"""
3336
When I transform constraint
3437
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\IntegerDoc"
@@ -49,14 +52,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
4952
Given I have the following Constraint:
5053
"""
5154
use Symfony\Component\Validator\Constraints as ConstraintNS;
52-
return new ConstraintNS\GreaterThan([
53-
'value' => 2.4,
54-
'payload' => [
55+
return new ConstraintNS\GreaterThan(
56+
2.4,
57+
null,
58+
null,
59+
null,
60+
[
5561
'documentation' => [
5662
'type' => 'float'
5763
]
5864
]
59-
]);
65+
);
6066
"""
6167
When I transform constraint
6268
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\FloatDoc"
@@ -77,14 +83,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
7783
Given I have the following Constraint:
7884
"""
7985
use Symfony\Component\Validator\Constraints as ConstraintNS;
80-
return new ConstraintNS\GreaterThan([
81-
'value' => 2,
82-
'payload' => [
86+
return new ConstraintNS\GreaterThan(
87+
2,
88+
null,
89+
null,
90+
null,
91+
[
8392
'documentation' => [
8493
'type' => 'array'
8594
]
8695
]
87-
]);
96+
);
8897
"""
8998
When I transform constraint
9099
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\ArrayDoc"
@@ -123,14 +132,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
123132
Given I have the following Constraint:
124133
"""
125134
use Symfony\Component\Validator\Constraints as ConstraintNS;
126-
return new ConstraintNS\GreaterThanOrEqual([
127-
'value' => 2,
128-
'payload' => [
135+
return new ConstraintNS\GreaterThanOrEqual(
136+
2,
137+
null,
138+
null,
139+
null,
140+
[
129141
'documentation' => [
130142
'type' => 'integer'
131143
]
132144
]
133-
]);
145+
);
134146
"""
135147
When I transform constraint
136148
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\IntegerDoc"
@@ -151,14 +163,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
151163
Given I have the following Constraint:
152164
"""
153165
use Symfony\Component\Validator\Constraints as ConstraintNS;
154-
return new ConstraintNS\GreaterThanOrEqual([
155-
'value' => 2.4,
156-
'payload' => [
166+
return new ConstraintNS\GreaterThanOrEqual(
167+
2.4,
168+
null,
169+
null,
170+
null,
171+
[
157172
'documentation' => [
158173
'type' => 'float'
159174
]
160175
]
161-
]);
176+
);
162177
"""
163178
When I transform constraint
164179
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\FloatDoc"
@@ -179,14 +194,17 @@ Feature: ConstraintToParamsDocTransformer - GreaterThan & GreaterThanOrEqual con
179194
Given I have the following Constraint:
180195
"""
181196
use Symfony\Component\Validator\Constraints as ConstraintNS;
182-
return new ConstraintNS\GreaterThanOrEqual([
183-
'value' => 2,
184-
'payload' => [
197+
return new ConstraintNS\GreaterThanOrEqual(
198+
2,
199+
null,
200+
null,
201+
null,
202+
[
185203
'documentation' => [
186204
'type' => 'array'
187205
]
188206
]
189-
]);
207+
);
190208
"""
191209
When I transform constraint
192210
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\ArrayDoc"

features/03_comparaison-constraints/greaterThan-constraints_fully-configured.feature

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
44
Given I have the following Constraint:
55
"""
66
use Symfony\Component\Validator\Constraints as ConstraintNS;
7-
return new ConstraintNS\GreaterThan([
8-
'value' => 2,
9-
'payload' => [
7+
return new ConstraintNS\GreaterThan(
8+
2,
9+
null,
10+
null,
11+
null,
12+
[
1013
'documentation' => [
1114
'description' => 'description',
1215
'default' => 'default',
@@ -15,7 +18,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
1518
'nullable' => false
1619
]
1720
]
18-
]);
21+
);
1922
"""
2023
When I transform constraint
2124
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\TypeDoc"
@@ -31,9 +34,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
3134
Given I have the following Constraint:
3235
"""
3336
use Symfony\Component\Validator\Constraints as ConstraintNS;
34-
return new ConstraintNS\GreaterThan([
35-
'value' => 2,
36-
'payload' => [
37+
return new ConstraintNS\GreaterThan(
38+
2,
39+
null,
40+
null,
41+
null,
42+
[
3743
'documentation' => [
3844
'type' => 'integer',
3945
'description' => 'description',
@@ -43,7 +49,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
4349
'nullable' => false
4450
]
4551
]
46-
]);
52+
);
4753
"""
4854
When I transform constraint
4955
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\IntegerDoc"
@@ -63,9 +69,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
6369
Given I have the following Constraint:
6470
"""
6571
use Symfony\Component\Validator\Constraints as ConstraintNS;
66-
return new ConstraintNS\GreaterThan([
67-
'value' => 2.4,
68-
'payload' => [
72+
return new ConstraintNS\GreaterThan(
73+
2.4,
74+
null,
75+
null,
76+
null,
77+
[
6978
'documentation' => [
7079
'type' => 'float',
7180
'description' => 'description',
@@ -75,7 +84,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
7584
'nullable' => false
7685
]
7786
]
78-
]);
87+
);
7988
"""
8089
When I transform constraint
8190
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\FloatDoc"
@@ -95,9 +104,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
95104
Given I have the following Constraint:
96105
"""
97106
use Symfony\Component\Validator\Constraints as ConstraintNS;
98-
return new ConstraintNS\GreaterThan([
99-
'value' => 2,
100-
'payload' => [
107+
return new ConstraintNS\GreaterThan(
108+
2,
109+
null,
110+
null,
111+
null,
112+
[
101113
'documentation' => [
102114
'type' => 'array',
103115
'description' => 'description',
@@ -107,7 +119,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
107119
'nullable' => false
108120
]
109121
]
110-
]);
122+
);
111123
"""
112124
When I transform constraint
113125
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\ArrayDoc"
@@ -128,9 +140,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
128140
Given I have the following Constraint:
129141
"""
130142
use Symfony\Component\Validator\Constraints as ConstraintNS;
131-
return new ConstraintNS\GreaterThanOrEqual([
132-
'value' => 2,
133-
'payload' => [
143+
return new ConstraintNS\GreaterThanOrEqual(
144+
2,
145+
null,
146+
null,
147+
null,
148+
[
134149
'documentation' => [
135150
'description' => 'description',
136151
'default' => 'default',
@@ -139,7 +154,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
139154
'nullable' => false
140155
]
141156
]
142-
]);
157+
);
143158
"""
144159
When I transform constraint
145160
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\TypeDoc"
@@ -155,9 +170,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
155170
Given I have the following Constraint:
156171
"""
157172
use Symfony\Component\Validator\Constraints as ConstraintNS;
158-
return new ConstraintNS\GreaterThanOrEqual([
159-
'value' => 2,
160-
'payload' => [
173+
return new ConstraintNS\GreaterThanOrEqual(
174+
2,
175+
null,
176+
null,
177+
null,
178+
[
161179
'documentation' => [
162180
'type' => 'integer',
163181
'description' => 'description',
@@ -167,7 +185,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
167185
'nullable' => false
168186
]
169187
]
170-
]);
188+
);
171189
"""
172190
When I transform constraint
173191
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\IntegerDoc"
@@ -187,9 +205,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
187205
Given I have the following Constraint:
188206
"""
189207
use Symfony\Component\Validator\Constraints as ConstraintNS;
190-
return new ConstraintNS\GreaterThanOrEqual([
191-
'value' => 2.4,
192-
'payload' => [
208+
return new ConstraintNS\GreaterThanOrEqual(
209+
2.4,
210+
null,
211+
null,
212+
null,
213+
[
193214
'documentation' => [
194215
'type' => 'float',
195216
'description' => 'description',
@@ -199,7 +220,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
199220
'nullable' => false
200221
]
201222
]
202-
]);
223+
);
203224
"""
204225
When I transform constraint
205226
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\FloatDoc"
@@ -219,9 +240,12 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
219240
Given I have the following Constraint:
220241
"""
221242
use Symfony\Component\Validator\Constraints as ConstraintNS;
222-
return new ConstraintNS\GreaterThanOrEqual([
223-
'value' => 2,
224-
'payload' => [
243+
return new ConstraintNS\GreaterThanOrEqual(
244+
2,
245+
null,
246+
null,
247+
null,
248+
[
225249
'documentation' => [
226250
'type' => 'array',
227251
'description' => 'description',
@@ -231,7 +255,7 @@ Feature: ConstraintToParamsDocTransformer - Fully configured GreaterThan & Great
231255
'nullable' => false
232256
]
233257
]
234-
]);
258+
);
235259
"""
236260
When I transform constraint
237261
Then I should have a constraint doc of class "Yoanm\JsonRpcServerDoc\Domain\Model\Type\ArrayDoc"

0 commit comments

Comments
 (0)