Skip to content

Commit 17bb6ce

Browse files
Merge branch '6.2' into 6.3
* 6.2: Fix merge Migrate to `static` data providers using `rector/rector`
2 parents c5f3f54 + a3fedae commit 17bb6ce

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function testComplete(array $input, array $expectedSuggestions)
161161
$this->assertSame($expectedSuggestions, $tester->complete($input));
162162
}
163163

164-
public function provideCompletionSuggestions()
164+
public static function provideCompletionSuggestions()
165165
{
166166
yield 'option' => [['--format', ''], ['txt', 'json', 'github']];
167167
}

Tests/DumperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function testEscapedEscapeSequencesInQuotedScalar($input, $expected)
225225
$this->assertSameData($input, $this->parser->parse($expected));
226226
}
227227

228-
public function getEscapeSequences()
228+
public static function getEscapeSequences()
229229
{
230230
return [
231231
'empty string' => ['', "''"],
@@ -275,7 +275,7 @@ public function testDumpObjectAsMap($object, $expected)
275275
$this->assertSameData($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
276276
}
277277

278-
public function objectAsMapProvider()
278+
public static function objectAsMapProvider()
279279
{
280280
$tests = [];
281281

@@ -825,7 +825,7 @@ public function testDumpInlineNumericKeyAsString(array $input, bool $inline, int
825825
$this->assertSame($expected, $this->dumper->dump($input, $inline ? 0 : 4, 0, $flags));
826826
}
827827

828-
public function getNumericKeyData()
828+
public static function getNumericKeyData()
829829
{
830830
yield 'Int key with flag inline' => [
831831
[200 => 'foo'],
@@ -930,7 +930,7 @@ public function testDumpDateTime(array $input, string $expected)
930930
$this->assertSame($expected, rtrim($this->dumper->dump($input, 1)));
931931
}
932932

933-
public function getDateTimeData()
933+
public static function getDateTimeData()
934934
{
935935
yield 'Date without subsecond precision' => [
936936
['date' => new \DateTimeImmutable('2023-01-24T01:02:03Z')],

Tests/InlineTest.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testParsePhpConstants($yaml, $value)
5454
$this->assertSame($value, $actual);
5555
}
5656

57-
public function getTestsForParsePhpConstants()
57+
public static function getTestsForParsePhpConstants()
5858
{
5959
return [
6060
['!php/const Symfony\Component\Yaml\Yaml::PARSE_CONSTANT', Yaml::PARSE_CONSTANT],
@@ -225,7 +225,7 @@ public function testParseReferences($yaml, $expected)
225225
$this->assertSame($expected, Inline::parse($yaml, 0, $references));
226226
}
227227

228-
public function getDataForParseReferences()
228+
public static function getDataForParseReferences()
229229
{
230230
return [
231231
'scalar' => ['*var', 'var-value'],
@@ -275,7 +275,7 @@ public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
275275
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
276276
}
277277

278-
public function getReservedIndicators()
278+
public static function getReservedIndicators()
279279
{
280280
return [['@'], ['`']];
281281
}
@@ -291,7 +291,7 @@ public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
291291
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
292292
}
293293

294-
public function getScalarIndicators()
294+
public static function getScalarIndicators()
295295
{
296296
return [['|'], ['>'], ['%']];
297297
}
@@ -304,7 +304,7 @@ public function testIsHash($array, $expected)
304304
$this->assertSame($expected, Inline::isHash($array));
305305
}
306306

307-
public function getDataForIsHash()
307+
public static function getDataForIsHash()
308308
{
309309
return [
310310
[[], false],
@@ -314,7 +314,7 @@ public function getDataForIsHash()
314314
];
315315
}
316316

317-
public function getTestsForParse()
317+
public static function getTestsForParse()
318318
{
319319
return [
320320
['', ''],
@@ -400,7 +400,7 @@ public function getTestsForParse()
400400
];
401401
}
402402

403-
public function getTestsForParseWithMapObjects()
403+
public static function getTestsForParseWithMapObjects()
404404
{
405405
return [
406406
['', ''],
@@ -481,7 +481,7 @@ public function getTestsForParseWithMapObjects()
481481
];
482482
}
483483

484-
public function getTestsForDump()
484+
public static function getTestsForDump()
485485
{
486486
return [
487487
['null', null],
@@ -584,7 +584,7 @@ public function testParseTimestampAsDateTimeObject(string $yaml, int $year, int
584584
$this->assertSame($timezone, $date->format('O'));
585585
}
586586

587-
public function getTimestampTests(): array
587+
public static function getTimestampTests(): array
588588
{
589589
return [
590590
'canonical' => ['2001-12-15T02:59:43.1Z', 2001, 12, 15, 2, 59, 43, 100000, '+0000'],
@@ -626,7 +626,7 @@ public function testDumpNumericKeyAsString(array|int $input, int $flags, string
626626
$this->assertSame($expected, Inline::dump($input, $flags));
627627
}
628628

629-
public function getNumericKeyData()
629+
public static function getNumericKeyData()
630630
{
631631
yield 'Int with flag' => [
632632
200,
@@ -725,7 +725,7 @@ public function testParseBackedEnumValue()
725725
$this->assertSame(FooBackedEnum::BAR->value, Inline::parse("!php/enum Symfony\Component\Yaml\Tests\Fixtures\FooBackedEnum::BAR->value", Yaml::PARSE_CONSTANT));
726726
}
727727

728-
public function getDateTimeDumpTests()
728+
public static function getDateTimeDumpTests()
729729
{
730730
$tests = [];
731731

@@ -746,7 +746,7 @@ public function testParseBinaryData($data)
746746
$this->assertSame('Hello world', Inline::parse($data));
747747
}
748748

749-
public function getBinaryData()
749+
public static function getBinaryData()
750750
{
751751
return [
752752
'enclosed with double quotes' => ['!!binary "SGVsbG8gd29ybGQ="'],
@@ -766,7 +766,7 @@ public function testParseInvalidBinaryData($data, $expectedMessage)
766766
Inline::parse($data);
767767
}
768768

769-
public function getInvalidBinaryData()
769+
public static function getInvalidBinaryData()
770770
{
771771
return [
772772
'length not a multiple of four' => ['!!binary "SGVsbG8d29ybGQ="', '/The normalized base64 encoded data \(data without whitespace characters\) length must be a multiple of four \(\d+ bytes given\)/'],
@@ -808,7 +808,7 @@ public function testParseMissingMappingValueAsNull($yaml, $expected)
808808
$this->assertSame($expected, Inline::parse($yaml));
809809
}
810810

811-
public function getTestsForNullValues()
811+
public static function getTestsForNullValues()
812812
{
813813
return [
814814
'null before closing curly brace' => ['{foo:}', ['foo' => null]],
@@ -831,7 +831,7 @@ public function testImplicitStringCastingOfMappingKeysIsDeprecated($yaml, $expec
831831
$this->assertSame($expected, Inline::parse($yaml));
832832
}
833833

834-
public function getNotPhpCompatibleMappingKeyData()
834+
public static function getNotPhpCompatibleMappingKeyData()
835835
{
836836
return [
837837
'boolean-true' => ['{true: "foo"}', ['true' => 'foo']],
@@ -910,7 +910,7 @@ public function testParseOctalNumbers($expected, $yaml)
910910
self::assertSame($expected, Inline::parse($yaml));
911911
}
912912

913-
public function getTestsForOctalNumbers()
913+
public static function getTestsForOctalNumbers()
914914
{
915915
return [
916916
'positive octal number' => [28, '0o34'],
@@ -927,7 +927,7 @@ public function testParseOctalNumbersYaml11Notation(string $expected, string $ya
927927
self::assertSame($expected, Inline::parse($yaml));
928928
}
929929

930-
public function getTestsForOctalNumbersYaml11Notation()
930+
public static function getTestsForOctalNumbersYaml11Notation()
931931
{
932932
return [
933933
'positive octal number' => ['034', '034'],
@@ -949,7 +949,7 @@ public function testPhpObjectWithEmptyValue(string $value)
949949
Inline::parse($value, Yaml::PARSE_OBJECT);
950950
}
951951

952-
public function phpObjectTagWithEmptyValueProvider()
952+
public static function phpObjectTagWithEmptyValueProvider()
953953
{
954954
return [
955955
['!php/object'],
@@ -983,7 +983,7 @@ public function testPhpEnumTagWithEmptyValue(string $value)
983983
Inline::parse(str_replace('!php/const', '!php/enum', $value), Yaml::PARSE_CONSTANT);
984984
}
985985

986-
public function phpConstTagWithEmptyValueProvider()
986+
public static function phpConstTagWithEmptyValueProvider()
987987
{
988988
return [
989989
['!php/const'],
@@ -1019,7 +1019,7 @@ public function testUnquotedExclamationMarkThrows(string $value)
10191019
Inline::parse($value);
10201020
}
10211021

1022-
public function unquotedExclamationMarkThrowsProvider()
1022+
public static function unquotedExclamationMarkThrowsProvider()
10231023
{
10241024
return [
10251025
['!'],
@@ -1051,7 +1051,7 @@ public function testQuotedExclamationMark($expected, string $value)
10511051
}
10521052

10531053
// This provider should stay consistent with unquotedExclamationMarkThrowsProvider
1054-
public function quotedExclamationMarkProvider()
1054+
public static function quotedExclamationMarkProvider()
10551055
{
10561056
return [
10571057
['!', '"!"'],
@@ -1081,7 +1081,7 @@ public function testParseIdeographicSpace(string $yaml, string $expected)
10811081
$this->assertSame($expected, Inline::parse($yaml));
10821082
}
10831083

1084-
public function ideographicSpaceProvider(): array
1084+
public static function ideographicSpaceProvider(): array
10851085
{
10861086
return [
10871087
["\u{3000}", ' '],

Tests/ParserTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function testTabsAsIndentationInYaml(string $given, string $expectedMessa
146146
$this->parser->parse($given);
147147
}
148148

149-
public function invalidIndentation(): array
149+
public static function invalidIndentation(): array
150150
{
151151
return [
152152
[
@@ -191,7 +191,7 @@ public function testValidTokenSeparation(string $given, array $expected)
191191
$this->assertSameData($expected, $actual);
192192
}
193193

194-
public function validTokenSeparators(): array
194+
public static function validTokenSeparators(): array
195195
{
196196
return [
197197
[
@@ -224,7 +224,7 @@ public function testEndOfTheDocumentMarker()
224224
$this->assertEquals('foo', $this->parser->parse($yaml));
225225
}
226226

227-
public function getBlockChompingTests()
227+
public static function getBlockChompingTests()
228228
{
229229
$tests = [];
230230

@@ -588,7 +588,7 @@ public function testObjectForMap($yaml, $expected)
588588
$this->assertSameData($expected, $this->parser->parse($yaml, $flags));
589589
}
590590

591-
public function getObjectForMapTests()
591+
public static function getObjectForMapTests()
592592
{
593593
$tests = [];
594594

@@ -835,7 +835,7 @@ public function testNonStringFollowedByCommentEmbeddedInMapping()
835835
$this->assertSame($expected, $this->parser->parse($yaml));
836836
}
837837

838-
public function getParseExceptionNotAffectedMultiLineStringLastResortParsing()
838+
public static function getParseExceptionNotAffectedMultiLineStringLastResortParsing()
839839
{
840840
$tests = [];
841841

@@ -977,7 +977,7 @@ public function testParseExceptionOnDuplicate($input, $duplicateKey, $lineNumber
977977
Yaml::parse($input);
978978
}
979979

980-
public function getParseExceptionOnDuplicateData()
980+
public static function getParseExceptionOnDuplicateData()
981981
{
982982
$tests = [];
983983

@@ -1282,7 +1282,7 @@ public function testCommentLikeStringsAreNotStrippedInBlockScalars($yaml, $expec
12821282
$this->assertSame($expectedParserResult, $this->parser->parse($yaml));
12831283
}
12841284

1285-
public function getCommentLikeStringInScalarBlockData()
1285+
public static function getCommentLikeStringInScalarBlockData()
12861286
{
12871287
$tests = [];
12881288

@@ -1467,7 +1467,7 @@ public function testParseBinaryData($data)
14671467
$this->assertSame(['data' => 'Hello world'], $this->parser->parse($data));
14681468
}
14691469

1470-
public function getBinaryData()
1470+
public static function getBinaryData()
14711471
{
14721472
return [
14731473
'enclosed with double quotes' => ['data: !!binary "SGVsbG8gd29ybGQ="'],
@@ -1499,7 +1499,7 @@ public function testParseInvalidBinaryData($data, $expectedMessage)
14991499
$this->parser->parse($data);
15001500
}
15011501

1502-
public function getInvalidBinaryData()
1502+
public static function getInvalidBinaryData()
15031503
{
15041504
return [
15051505
'length not a multiple of four' => ['data: !!binary "SGVsbG8d29ybGQ="', '/The normalized base64 encoded data \(data without whitespace characters\) length must be a multiple of four \(\d+ bytes given\)/'],
@@ -1574,7 +1574,7 @@ public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yam
15741574
$this->parser->parse($yaml);
15751575
}
15761576

1577-
public function parserThrowsExceptionWithCorrectLineNumberProvider()
1577+
public static function parserThrowsExceptionWithCorrectLineNumberProvider()
15781578
{
15791579
return [
15801580
[
@@ -1731,7 +1731,7 @@ public function testParseQuotedStringContainingEscapedQuotationCharacters(string
17311731
$this->assertSame($expected, $this->parser->parse($yaml));
17321732
}
17331733

1734-
public function escapedQuotationCharactersInQuotedStrings()
1734+
public static function escapedQuotationCharactersInQuotedStrings()
17351735
{
17361736
return [
17371737
'single quoted string' => [
@@ -1789,7 +1789,7 @@ public function testParseMultiLineMappingValue($yaml, $expected, $parseError)
17891789
$this->assertSame($expected, $this->parser->parse($yaml));
17901790
}
17911791

1792-
public function multiLineDataProvider()
1792+
public static function multiLineDataProvider()
17931793
{
17941794
$tests = [];
17951795

@@ -1856,7 +1856,7 @@ public function testInlineNotationSpanningMultipleLines($expected, string $yaml)
18561856
$this->assertSame($expected, $this->parser->parse($yaml));
18571857
}
18581858

1859-
public function inlineNotationSpanningMultipleLinesProvider(): array
1859+
public static function inlineNotationSpanningMultipleLinesProvider(): array
18601860
{
18611861
return [
18621862
'mapping' => [
@@ -2245,7 +2245,7 @@ public function testCustomTagSupport($expected, $yaml)
22452245
$this->assertSameData($expected, $this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS));
22462246
}
22472247

2248-
public function taggedValuesProvider()
2248+
public static function taggedValuesProvider()
22492249
{
22502250
return [
22512251
'scalars' => [
@@ -2680,7 +2680,7 @@ public function testDetectCircularReferences($yaml)
26802680
$this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS);
26812681
}
26822682

2683-
public function circularReferenceProvider()
2683+
public static function circularReferenceProvider()
26842684
{
26852685
$tests = [];
26862686

@@ -2720,7 +2720,7 @@ public function testParseIndentedMappings($yaml, $expected)
27202720
$this->assertSame($expected, $this->parser->parse($yaml));
27212721
}
27222722

2723-
public function indentedMappingData()
2723+
public static function indentedMappingData()
27242724
{
27252725
$tests = [];
27262726

0 commit comments

Comments
 (0)