diff --git a/Tests/Command/LintCommandTest.php b/Tests/Command/LintCommandTest.php index 90e20455..4d3024cc 100644 --- a/Tests/Command/LintCommandTest.php +++ b/Tests/Command/LintCommandTest.php @@ -179,7 +179,7 @@ public function testComplete(array $input, array $expectedSuggestions) $this->assertSame($expectedSuggestions, $tester->complete($input)); } - public function provideCompletionSuggestions() + public static function provideCompletionSuggestions() { yield 'option' => [['--format', ''], ['txt', 'json', 'github']]; } diff --git a/Tests/DumperTest.php b/Tests/DumperTest.php index 16551f18..721b04ca 100644 --- a/Tests/DumperTest.php +++ b/Tests/DumperTest.php @@ -225,7 +225,7 @@ public function testEscapedEscapeSequencesInQuotedScalar($input, $expected) $this->assertSameData($input, $this->parser->parse($expected)); } - public function getEscapeSequences() + public static function getEscapeSequences() { return [ 'empty string' => ['', "''"], @@ -275,7 +275,7 @@ public function testDumpObjectAsMap($object, $expected) $this->assertSameData($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP)); } - public function objectAsMapProvider() + public static function objectAsMapProvider() { $tests = []; diff --git a/Tests/InlineTest.php b/Tests/InlineTest.php index f71509d2..8cd2582f 100644 --- a/Tests/InlineTest.php +++ b/Tests/InlineTest.php @@ -56,7 +56,7 @@ public function testParsePhpConstants($yaml, $value) $this->assertSame($value, $actual); } - public function getTestsForParsePhpConstants() + public static function getTestsForParsePhpConstants() { return [ ['!php/const Symfony\Component\Yaml\Yaml::PARSE_CONSTANT', Yaml::PARSE_CONSTANT], @@ -195,7 +195,7 @@ public function testParseReferences($yaml, $expected) $this->assertSame($expected, Inline::parse($yaml, 0, $references)); } - public function getDataForParseReferences() + public static function getDataForParseReferences() { return [ 'scalar' => ['*var', 'var-value'], @@ -245,7 +245,7 @@ public function testParseUnquotedScalarStartingWithReservedIndicator($indicator) Inline::parse(sprintf('{ foo: %sfoo }', $indicator)); } - public function getReservedIndicators() + public static function getReservedIndicators() { return [['@'], ['`']]; } @@ -261,7 +261,7 @@ public function testParseUnquotedScalarStartingWithScalarIndicator($indicator) Inline::parse(sprintf('{ foo: %sfoo }', $indicator)); } - public function getScalarIndicators() + public static function getScalarIndicators() { return [['|'], ['>'], ['%']]; } @@ -274,7 +274,7 @@ public function testIsHash($array, $expected) $this->assertSame($expected, Inline::isHash($array)); } - public function getDataForIsHash() + public static function getDataForIsHash() { return [ [[], false], @@ -284,7 +284,7 @@ public function getDataForIsHash() ]; } - public function getTestsForParse() + public static function getTestsForParse() { return [ ['', ''], @@ -370,7 +370,7 @@ public function getTestsForParse() ]; } - public function getTestsForParseWithMapObjects() + public static function getTestsForParseWithMapObjects() { return [ ['', ''], @@ -451,7 +451,7 @@ public function getTestsForParseWithMapObjects() ]; } - public function getTestsForDump() + public static function getTestsForDump() { return [ ['null', null], @@ -549,7 +549,7 @@ public function testParseTimestampAsDateTimeObject(string $yaml, int $year, int $this->assertSame($timezone, $date->format('O')); } - public function getTimestampTests(): array + public static function getTimestampTests(): array { return [ 'canonical' => ['2001-12-15T02:59:43.1Z', 2001, 12, 15, 2, 59, 43, 100000, '+0000'], @@ -591,7 +591,7 @@ public function testDumpUnitEnum() $this->assertSame("!php/const Symfony\Component\Yaml\Tests\Fixtures\FooUnitEnum::BAR", Inline::dump(FooUnitEnum::BAR)); } - public function getDateTimeDumpTests() + public static function getDateTimeDumpTests() { $tests = []; @@ -612,7 +612,7 @@ public function testParseBinaryData($data) $this->assertSame('Hello world', Inline::parse($data)); } - public function getBinaryData() + public static function getBinaryData() { return [ 'enclosed with double quotes' => ['!!binary "SGVsbG8gd29ybGQ="'], @@ -632,7 +632,7 @@ public function testParseInvalidBinaryData($data, $expectedMessage) Inline::parse($data); } - public function getInvalidBinaryData() + public static function getInvalidBinaryData() { return [ '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\)/'], @@ -674,7 +674,7 @@ public function testParseMissingMappingValueAsNull($yaml, $expected) $this->assertSame($expected, Inline::parse($yaml)); } - public function getTestsForNullValues() + public static function getTestsForNullValues() { return [ 'null before closing curly brace' => ['{foo:}', ['foo' => null]], @@ -697,7 +697,7 @@ public function testImplicitStringCastingOfMappingKeysIsDeprecated($yaml, $expec $this->assertSame($expected, Inline::parse($yaml)); } - public function getNotPhpCompatibleMappingKeyData() + public static function getNotPhpCompatibleMappingKeyData() { return [ 'boolean-true' => ['{true: "foo"}', ['true' => 'foo']], @@ -776,7 +776,7 @@ public function testParseOctalNumbers($expected, $yaml) self::assertSame($expected, Inline::parse($yaml)); } - public function getTestsForOctalNumbers() + public static function getTestsForOctalNumbers() { return [ 'positive octal number' => [28, '0o34'], @@ -797,7 +797,7 @@ public function testParseOctalNumbersYaml11Notation(int $expected, string $yaml, self::assertSame($expected, Inline::parse($yaml)); } - public function getTestsForOctalNumbersYaml11Notation() + public static function getTestsForOctalNumbersYaml11Notation() { return [ 'positive octal number' => [28, '034', '0o34'], @@ -818,7 +818,7 @@ public function testPhpObjectWithEmptyValue($expected, $value) $this->assertSame($expected, Inline::parse($value, Yaml::PARSE_OBJECT)); } - public function phpObjectTagWithEmptyValueProvider() + public static function phpObjectTagWithEmptyValueProvider() { return [ [false, '!php/object'], @@ -842,7 +842,7 @@ public function testPhpConstTagWithEmptyValue($expected, $value) $this->assertSame($expected, Inline::parse($value, Yaml::PARSE_CONSTANT)); } - public function phpConstTagWithEmptyValueProvider() + public static function phpConstTagWithEmptyValueProvider() { return [ ['', '!php/const'], @@ -894,7 +894,7 @@ public function testUnquotedExclamationMarkThrows(string $value) Inline::parse($value); } - public function unquotedExclamationMarkThrowsProvider() + public static function unquotedExclamationMarkThrowsProvider() { return [ ['!'], @@ -926,7 +926,7 @@ public function testQuotedExclamationMark($expected, string $value) } // This provider should stay consistent with unquotedExclamationMarkThrowsProvider - public function quotedExclamationMarkProvider() + public static function quotedExclamationMarkProvider() { return [ ['!', '"!"'], @@ -956,7 +956,7 @@ public function testParseIdeographicSpace(string $yaml, string $expected) $this->assertSame($expected, Inline::parse($yaml)); } - public function ideographicSpaceProvider(): array + public static function ideographicSpaceProvider(): array { return [ ["\u{3000}", ' '], diff --git a/Tests/ParserTest.php b/Tests/ParserTest.php index b09ff090..98e5e73e 100644 --- a/Tests/ParserTest.php +++ b/Tests/ParserTest.php @@ -144,7 +144,7 @@ public function testTabsAsIndentationInYaml(string $given, string $expectedMessa $this->parser->parse($given); } - public function invalidIndentation(): array + public static function invalidIndentation(): array { return [ [ @@ -189,7 +189,7 @@ public function testValidTokenSeparation(string $given, array $expected) $this->assertSameData($expected, $actual); } - public function validTokenSeparators(): array + public static function validTokenSeparators(): array { return [ [ @@ -222,7 +222,7 @@ public function testEndOfTheDocumentMarker() $this->assertEquals('foo', $this->parser->parse($yaml)); } - public function getBlockChompingTests() + public static function getBlockChompingTests() { $tests = []; @@ -586,7 +586,7 @@ public function testObjectForMap($yaml, $expected) $this->assertSameData($expected, $this->parser->parse($yaml, $flags)); } - public function getObjectForMapTests() + public static function getObjectForMapTests() { $tests = []; @@ -833,7 +833,7 @@ public function testNonStringFollowedByCommentEmbeddedInMapping() $this->assertSame($expected, $this->parser->parse($yaml)); } - public function getParseExceptionNotAffectedMultiLineStringLastResortParsing() + public static function getParseExceptionNotAffectedMultiLineStringLastResortParsing() { $tests = []; @@ -975,7 +975,7 @@ public function testParseExceptionOnDuplicate($input, $duplicateKey, $lineNumber Yaml::parse($input); } - public function getParseExceptionOnDuplicateData() + public static function getParseExceptionOnDuplicateData() { $tests = []; @@ -1280,7 +1280,7 @@ public function testCommentLikeStringsAreNotStrippedInBlockScalars($yaml, $expec $this->assertSame($expectedParserResult, $this->parser->parse($yaml)); } - public function getCommentLikeStringInScalarBlockData() + public static function getCommentLikeStringInScalarBlockData() { $tests = []; @@ -1465,7 +1465,7 @@ public function testParseBinaryData($data) $this->assertSame(['data' => 'Hello world'], $this->parser->parse($data)); } - public function getBinaryData() + public static function getBinaryData() { return [ 'enclosed with double quotes' => ['data: !!binary "SGVsbG8gd29ybGQ="'], @@ -1497,7 +1497,7 @@ public function testParseInvalidBinaryData($data, $expectedMessage) $this->parser->parse($data); } - public function getInvalidBinaryData() + public static function getInvalidBinaryData() { return [ '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\)/'], @@ -1563,7 +1563,7 @@ public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yam $this->parser->parse($yaml); } - public function parserThrowsExceptionWithCorrectLineNumberProvider() + public static function parserThrowsExceptionWithCorrectLineNumberProvider() { return [ [ @@ -1720,7 +1720,7 @@ public function testParseQuotedStringContainingEscapedQuotationCharacters(string $this->assertSame($expected, $this->parser->parse($yaml)); } - public function escapedQuotationCharactersInQuotedStrings() + public static function escapedQuotationCharactersInQuotedStrings() { return [ 'single quoted string' => [ @@ -1778,7 +1778,7 @@ public function testParseMultiLineMappingValue($yaml, $expected, $parseError) $this->assertSame($expected, $this->parser->parse($yaml)); } - public function multiLineDataProvider() + public static function multiLineDataProvider() { $tests = []; @@ -1845,7 +1845,7 @@ public function testInlineNotationSpanningMultipleLines($expected, string $yaml) $this->assertSame($expected, $this->parser->parse($yaml)); } - public function inlineNotationSpanningMultipleLinesProvider(): array + public static function inlineNotationSpanningMultipleLinesProvider(): array { return [ 'mapping' => [ @@ -2234,7 +2234,7 @@ public function testCustomTagSupport($expected, $yaml) $this->assertSameData($expected, $this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS)); } - public function taggedValuesProvider() + public static function taggedValuesProvider() { return [ 'scalars' => [ @@ -2658,7 +2658,7 @@ public function testDetectCircularReferences($yaml) $this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS); } - public function circularReferenceProvider() + public static function circularReferenceProvider() { $tests = []; @@ -2698,7 +2698,7 @@ public function testParseIndentedMappings($yaml, $expected) $this->assertSame($expected, $this->parser->parse($yaml)); } - public function indentedMappingData() + public static function indentedMappingData() { $tests = [];