Skip to content

Commit 133797d

Browse files
Merge branch '6.2' into 6.3
* 6.2: Fix merge Migrate to `static` data providers using `rector/rector`
2 parents c91239c + e34c975 commit 133797d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+166
-166
lines changed

Tests/ConstraintValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testFormatValue($expected, $value, $format = 0)
2727
$this->assertSame($expected, (new TestFormatValueConstraintValidator())->formatValueProxy($value, $format));
2828
}
2929

30-
public function formatValueProvider()
30+
public static function formatValueProvider()
3131
{
3232
$defaultTimezone = date_default_timezone_get();
3333
date_default_timezone_set('Europe/Moscow'); // GMT+3

Tests/ConstraintViolationListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function testFindByCodes($code, $violationsCount)
146146
$this->assertCount($violationsCount, $specificErrors);
147147
}
148148

149-
public function findByCodesProvider()
149+
public static function findByCodesProvider()
150150
{
151151
return [
152152
['code1', 2],

Tests/Constraints/AllValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testWalkMultipleConstraints($array)
7777
$this->assertNoViolation();
7878
}
7979

80-
public function getValidArguments()
80+
public static function getValidArguments()
8181
{
8282
return [
8383
[[5, 6, 7]],

Tests/Constraints/AtLeastOneOfValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testValidCombinations($value, $constraints)
5656
$this->assertCount(0, Validation::createValidator()->validate($value, new AtLeastOneOf($constraints)));
5757
}
5858

59-
public function getValidCombinations()
59+
public static function getValidCombinations()
6060
{
6161
return [
6262
['symfony', [
@@ -125,7 +125,7 @@ public function testInvalidCombinationsWithCustomMessage($value, $constraints)
125125
$this->assertEquals(new ConstraintViolation('foo', 'foo', [], $value, '', $value, null, AtLeastOneOf::AT_LEAST_ONE_OF_ERROR, $atLeastOneOf), $violations->get(0));
126126
}
127127

128-
public function getInvalidCombinations()
128+
public static function getInvalidCombinations()
129129
{
130130
return [
131131
['symphony', [

Tests/Constraints/BicValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function testValidBics($bic)
188188
$this->assertNoViolation();
189189
}
190190

191-
public function getValidBics()
191+
public static function getValidBics()
192192
{
193193
// http://formvalidation.io/validators/bic/
194194
return [
@@ -233,7 +233,7 @@ public function testInvalidBicsNamed($bic, $code)
233233
->assertRaised();
234234
}
235235

236-
public function getInvalidBics()
236+
public static function getInvalidBics()
237237
{
238238
return [
239239
['DEUTD', Bic::INVALID_LENGTH_ERROR],
@@ -277,7 +277,7 @@ public function testValidBicSpecialCases(string $bic, string $iban)
277277
$this->assertNoViolation();
278278
}
279279

280-
public function getValidBicSpecialCases()
280+
public static function getValidBicSpecialCases()
281281
{
282282
// FR related special cases
283283
yield ['BNPAGFGX', 'FR14 2004 1010 0505 0001 3M02 606'];

Tests/Constraints/BlankValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testInvalidValues($value, $valueAsString)
5353
->assertRaised();
5454
}
5555

56-
public function getInvalidValues()
56+
public static function getInvalidValues()
5757
{
5858
return [
5959
['foobar', '"foobar"'],

Tests/Constraints/CardSchemeValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testInvalidNumberNamedArguments()
8787
->assertRaised();
8888
}
8989

90-
public function getValidNumbers()
90+
public static function getValidNumbers()
9191
{
9292
return [
9393
['AMEX', '378282246310005'],
@@ -142,7 +142,7 @@ public function getValidNumbers()
142142
];
143143
}
144144

145-
public function getInvalidNumbers()
145+
public static function getInvalidNumbers()
146146
{
147147
return [
148148
['VISA', '42424242424242424242', CardScheme::INVALID_FORMAT_ERROR],

Tests/Constraints/ChoiceValidatorTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testValidChoiceArray(Choice $constraint)
8484
$this->assertNoViolation();
8585
}
8686

87-
public function provideConstraintsWithChoicesArray(): iterable
87+
public static function provideConstraintsWithChoicesArray(): iterable
8888
{
8989
yield 'Doctrine style' => [new Choice(['choices' => ['foo', 'bar']])];
9090
yield 'Doctrine default option' => [new Choice(['value' => ['foo', 'bar']])];
@@ -102,7 +102,7 @@ public function testValidChoiceCallbackFunction(Choice $constraint)
102102
$this->assertNoViolation();
103103
}
104104

105-
public function provideConstraintsWithCallbackFunction(): iterable
105+
public static function provideConstraintsWithCallbackFunction(): iterable
106106
{
107107
yield 'doctrine style, namespaced function' => [new Choice(['callback' => __NAMESPACE__.'\choice_callback'])];
108108
yield 'doctrine style, closure' => [new Choice([
@@ -148,7 +148,7 @@ public function testMultipleChoices(Choice $constraint)
148148
$this->assertNoViolation();
149149
}
150150

151-
public function provideConstraintsWithMultipleTrue(): iterable
151+
public static function provideConstraintsWithMultipleTrue(): iterable
152152
{
153153
yield 'Doctrine style' => [new Choice([
154154
'choices' => ['foo', 'bar', 'baz'],
@@ -174,7 +174,7 @@ public function testInvalidChoice(Choice $constraint)
174174
->assertRaised();
175175
}
176176

177-
public function provideConstraintsWithMessage(): iterable
177+
public static function provideConstraintsWithMessage(): iterable
178178
{
179179
yield 'Doctrine style' => [new Choice(['choices' => ['foo', 'bar'], 'message' => 'myMessage'])];
180180
yield 'named arguments' => [new Choice(choices: ['foo', 'bar'], message: 'myMessage')];
@@ -213,7 +213,7 @@ public function testInvalidChoiceMultiple(Choice $constraint)
213213
->assertRaised();
214214
}
215215

216-
public function provideConstraintsWithMultipleMessage(): iterable
216+
public static function provideConstraintsWithMultipleMessage(): iterable
217217
{
218218
yield 'Doctrine style' => [new Choice([
219219
'choices' => ['foo', 'bar'],
@@ -246,7 +246,7 @@ public function testTooFewChoices(Choice $constraint)
246246
->assertRaised();
247247
}
248248

249-
public function provideConstraintsWithMin(): iterable
249+
public static function provideConstraintsWithMin(): iterable
250250
{
251251
yield 'Doctrine style' => [new Choice([
252252
'choices' => ['foo', 'bar', 'moo', 'maa'],
@@ -281,7 +281,7 @@ public function testTooManyChoices(Choice $constraint)
281281
->assertRaised();
282282
}
283283

284-
public function provideConstraintsWithMax(): iterable
284+
public static function provideConstraintsWithMax(): iterable
285285
{
286286
yield 'Doctrine style' => [new Choice([
287287
'choices' => ['foo', 'bar', 'moo', 'maa'],

Tests/Constraints/CidrTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testWithInvalidMinMaxValues(string $ipVersion, int $netmaskMin,
9090
]);
9191
}
9292

93-
public function getInvalidMinMaxValues(): array
93+
public static function getInvalidMinMaxValues(): array
9494
{
9595
return [
9696
[Ip::ALL, -1, 23],
@@ -108,7 +108,7 @@ public function getInvalidMinMaxValues(): array
108108
];
109109
}
110110

111-
public function getValidMinMaxValues(): array
111+
public static function getValidMinMaxValues(): array
112112
{
113113
return [
114114
[Ip::ALL, 0, 23],

Tests/Constraints/CidrValidatorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testWrongVersion(string $cidr, string $version)
135135
->assertRaised();
136136
}
137137

138-
public function getWithInvalidIps(): array
138+
public static function getWithInvalidIps(): array
139139
{
140140
return [
141141
['0/20'],
@@ -164,7 +164,7 @@ public function getWithInvalidIps(): array
164164
];
165165
}
166166

167-
public function getValid(): array
167+
public static function getValid(): array
168168
{
169169
return [
170170
['127.0.0.0/32', Ip::ALL],
@@ -198,7 +198,7 @@ public function getValid(): array
198198
];
199199
}
200200

201-
public function getWithInvalidNetmask(): array
201+
public static function getWithInvalidNetmask(): array
202202
{
203203
return [
204204
['192.168.1.0/-1'],
@@ -217,7 +217,7 @@ public function getWithInvalidNetmask(): array
217217
];
218218
}
219219

220-
public function getWithInvalidMasksAndIps(): array
220+
public static function getWithInvalidMasksAndIps(): array
221221
{
222222
return [
223223
['0.0.0.0/foobar'],
@@ -236,15 +236,15 @@ public function getWithInvalidMasksAndIps(): array
236236
];
237237
}
238238

239-
public function getOutOfRangeNetmask(): array
239+
public static function getOutOfRangeNetmask(): array
240240
{
241241
return [
242242
['10.0.0.0/24', Ip::V4, 10, 20],
243243
['2001:0DB8:85A3:0000:0000:8A2E:0370:7334/24', Ip::V6, 10, 20],
244244
];
245245
}
246246

247-
public function getWithWrongVersion(): array
247+
public static function getWithWrongVersion(): array
248248
{
249249
return [
250250
['2001:0db8:85a3:0000:0000:8a2e:0370:7334/12', Ip::V4],

Tests/Constraints/CountryValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testValidCountries($country)
7070
$this->assertNoViolation();
7171
}
7272

73-
public function getValidCountries()
73+
public static function getValidCountries()
7474
{
7575
return [
7676
['GB'],
@@ -96,7 +96,7 @@ public function testInvalidCountries($country)
9696
->assertRaised();
9797
}
9898

99-
public function getInvalidCountries()
99+
public static function getInvalidCountries()
100100
{
101101
return [
102102
['foobar'],
@@ -116,7 +116,7 @@ public function testValidAlpha3Countries($country)
116116
$this->assertNoViolation();
117117
}
118118

119-
public function getValidAlpha3Countries()
119+
public static function getValidAlpha3Countries()
120120
{
121121
return [
122122
['GBR'],
@@ -143,7 +143,7 @@ public function testInvalidAlpha3Countries($country)
143143
->assertRaised();
144144
}
145145

146-
public function getInvalidAlpha3Countries()
146+
public static function getInvalidAlpha3Countries()
147147
{
148148
return [
149149
['foobar'],

0 commit comments

Comments
 (0)