Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Migrate to `static` data providers using `rector/rector`
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents 6a924d6 + 2a6b111 commit 249271d
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Tests/Builder/GeneratedConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function tearDown(): void
parent::tearDown();
}

public function fixtureNames()
public static function fixtureNames()
{
$array = [
'ScalarNormalizedTypes' => 'scalar_normalized_types',
Expand Down
2 changes: 1 addition & 1 deletion Tests/ConfigCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testStaleResourceInDebug()
$this->assertFalse($cache->isFresh());
}

public function debugModes(): array
public static function debugModes(): array
{
return [
[true],
Expand Down
10 changes: 5 additions & 5 deletions Tests/Definition/ArrayNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testNormalizeWithoutProposals()
$node->normalize(['beta' => 'foo']);
}

public function ignoreAndRemoveMatrixProvider(): array
public static function ignoreAndRemoveMatrixProvider(): array
{
$unrecognizedOptionException = new InvalidConfigurationException('Unrecognized option "foo" under "root"');

Expand Down Expand Up @@ -94,7 +94,7 @@ public function testPreNormalize(array $denormalized, array $normalized)
$this->assertSame($normalized, $r->invoke($node, $denormalized));
}

public function getPreNormalizationTests(): array
public static function getPreNormalizationTests(): array
{
return [
[
Expand Down Expand Up @@ -135,7 +135,7 @@ public function testNodeNameCanBeZero(array $denormalized, array $normalized)
$this->assertSame($normalized, $r->invoke($rootNode, $denormalized));
}

public function getZeroNamedNodeExamplesData(): array
public static function getZeroNamedNodeExamplesData(): array
{
return [
[
Expand Down Expand Up @@ -181,7 +181,7 @@ public function testChildrenOrderIsMaintainedOnNormalizeValue(array $prenormaliz
$this->assertSame($normalized, $r->invoke($node, $prenormalized));
}

public function getPreNormalizedNormalizedOrderedData(): array
public static function getPreNormalizedNormalizedOrderedData(): array
{
return [
[
Expand Down Expand Up @@ -311,7 +311,7 @@ public function testMergeWithIgnoringExtraKeys(array $prenormalizeds, array $mer
$this->assertEquals($merged, $r->invoke($node, ...$prenormalizeds));
}

public function getDataWithIncludedExtraKeys(): array
public static function getDataWithIncludedExtraKeys(): array
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion Tests/Definition/BaseNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testGetPathForChildNode(string $expected, array $params)
$this->assertSame($expected, $node->getPath());
}

public function providePath(): array
public static function providePath(): array
{
return [
'name only' => ['root', ['root']],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Definition/BooleanNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testValidNonEmptyValues(bool $value)
$this->assertSame($value, $node->finalize($value));
}

public function getValidValues(): array
public static function getValidValues(): array
{
return [
[false],
Expand All @@ -55,7 +55,7 @@ public function testNormalizeThrowsExceptionOnInvalidValues($value)
$node->normalize($value);
}

public function getInvalidValues(): array
public static function getInvalidValues(): array
{
return [
[null],
Expand Down
6 changes: 3 additions & 3 deletions Tests/Definition/Builder/ArrayNodeDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testPrototypeNodeSpecificOption(string $method, array $args)
$node->getNode();
}

public function providePrototypeNodeSpecificCalls(): array
public static function providePrototypeNodeSpecificCalls(): array
{
return [
['defaultValue', [[]]],
Expand Down Expand Up @@ -132,7 +132,7 @@ public function testPrototypedArrayNodeDefault(int|array|string|null $args, bool
}
}

public function providePrototypedArrayNodeDefaults(): array
public static function providePrototypedArrayNodeDefaults(): array
{
return [
[null, true, false, [[]]],
Expand Down Expand Up @@ -293,7 +293,7 @@ public function testPrototypeEnum()
$this->assertEquals($node->prototype('enum'), $node->enumPrototype());
}

public function getEnableableNodeFixtures(): array
public static function getEnableableNodeFixtures(): array
{
return [
[['enabled' => true, 'foo' => 'bar'], [true], 'true enables an enableable node'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Definition/Builder/ExprBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testCastToArrayExpression($configValue, array $expectedValue)
$this->assertFinalizedValueIs($expectedValue, $test, ['key' => $configValue]);
}

public function castToArrayValues(): iterable
public static function castToArrayValues(): iterable
{
yield ['value', ['value']];
yield [-3.14, [-3.14]];
Expand Down
2 changes: 1 addition & 1 deletion Tests/Definition/Dumper/YamlReferenceDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testDumper()
$this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
}

public function provideDumpAtPath(): array
public static function provideDumpAtPath(): array
{
return [
'Regular node' => ['scalar_true', <<<EOL
Expand Down
4 changes: 2 additions & 2 deletions Tests/Definition/FloatNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testValidNonEmptyValues(int|float $value)
$this->assertSame($value, $node->finalize($value));
}

public function getValidValues(): array
public static function getValidValues(): array
{
return [
[1798.0],
Expand All @@ -61,7 +61,7 @@ public function testNormalizeThrowsExceptionOnInvalidValues($value)
$node->normalize($value);
}

public function getInvalidValues(): array
public static function getInvalidValues(): array
{
return [
[null],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Definition/IntegerNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testValidNonEmptyValues(int $value)
$this->assertSame($value, $node->finalize($value));
}

public function getValidValues(): array
public static function getValidValues(): array
{
return [
[1798],
Expand All @@ -56,7 +56,7 @@ public function testNormalizeThrowsExceptionOnInvalidValues($value)
$node->normalize($value);
}

public function getInvalidValues(): array
public static function getInvalidValues(): array
{
return [
[null],
Expand Down
6 changes: 3 additions & 3 deletions Tests/Definition/NormalizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testNormalizeEncoders($denormalized)
$this->assertNormalized($tree, $denormalized, $normalized);
}

public function getEncoderTests(): array
public static function getEncoderTests(): array
{
$configs = [];

Expand Down Expand Up @@ -120,7 +120,7 @@ public function testAnonymousKeysArray($denormalized)
$this->assertNormalized($tree, $denormalized, $normalized);
}

public function getAnonymousKeysTests(): array
public static function getAnonymousKeysTests(): array
{
$configs = [];

Expand Down Expand Up @@ -151,7 +151,7 @@ public function testNumericKeysAsAttributes($denormalized)
$this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, $normalized);
}

public function getNumericKeysTests(): array
public static function getNumericKeysTests(): array
{
$configs = [];

Expand Down
4 changes: 2 additions & 2 deletions Tests/Definition/PrototypedArrayNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function testMappedAttributeKeyIsRemovedLeftValueOnly($value, array $chil
$this->assertEquals($expected, $normalized);
}

public function getDataForKeyRemovedLeftValueOnly(): array
public static function getDataForKeyRemovedLeftValueOnly(): array
{
$scalarValue = new ScalarNode('value');

Expand Down Expand Up @@ -354,7 +354,7 @@ public function testPrototypedArrayNodeMerge(array $left, array $right, array $e
self::assertSame($result, $expected);
}

public function getPrototypedArrayNodeDataToMerge(): array
public static function getPrototypedArrayNodeDataToMerge(): array
{
return [
// data to merged is a plain array
Expand Down
8 changes: 4 additions & 4 deletions Tests/Definition/ScalarNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testNormalize($value)
$this->assertSame($value, $node->normalize($value));
}

public function getValidValues(): array
public static function getValidValues(): array
{
return [
[false],
Expand Down Expand Up @@ -93,7 +93,7 @@ public function testNormalizeThrowsExceptionOnInvalidValues($value)
$node->normalize($value);
}

public function getInvalidValues(): array
public static function getInvalidValues(): array
{
return [
[[]],
Expand Down Expand Up @@ -136,7 +136,7 @@ public function testValidNonEmptyValues($value)
$this->assertSame($value, $node->finalize($value));
}

public function getValidNonEmptyValues(): array
public static function getValidNonEmptyValues(): array
{
return [
[false],
Expand All @@ -162,7 +162,7 @@ public function testNotAllowedEmptyValuesThrowException($value)
$node->finalize($value);
}

public function getEmptyValues(): array
public static function getEmptyValues(): array
{
return [
[null],
Expand Down
2 changes: 1 addition & 1 deletion Tests/FileLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testIsAbsolutePath(string $path)
$this->assertTrue($m->invoke($loader, $path), '->isAbsolutePath() returns true for an absolute path');
}

public function getIsAbsolutePathTests(): array
public static function getIsAbsolutePathTests(): array
{
return [
['/foo.xml'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Loader/FileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function testExcludeTrailingSlashConsistency(string $exclude)
$this->assertNotContains('baz.txt', $loadedFiles);
}

public function excludeTrailingSlashConsistencyProvider(): iterable
public static function excludeTrailingSlashConsistencyProvider(): iterable
{
yield [__DIR__.'/../Fixtures/Exclude/ExcludeToo/'];
yield [__DIR__.'/../Fixtures/Exclude/ExcludeToo'];
Expand Down
2 changes: 1 addition & 1 deletion Tests/Resource/ReflectionClassResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function testHashedSignature(bool $changeExpected, int $changedLine, ?str
}
}

public function provideHashedSignature(): iterable
public static function provideHashedSignature(): iterable
{
yield [false, 0, "// line change\n\n"];
yield [true, 0, '/** class docblock */'];
Expand Down
4 changes: 2 additions & 2 deletions Tests/Util/XmlUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testConvertDomToArray($expected, string $xml, bool $root = false
$this->assertSame($expected, XmlUtils::convertDomElementToArray($dom->documentElement, $checkPrefix));
}

public function getDataForConvertDomToArray(): array
public static function getDataForConvertDomToArray(): array
{
return [
[null, ''],
Expand Down Expand Up @@ -155,7 +155,7 @@ public function testPhpize($expected, string $value)
$this->assertSame($expected, XmlUtils::phpize($value));
}

public function getDataForPhpize(): array
public static function getDataForPhpize(): array
{
return [
['', ''],
Expand Down

0 comments on commit 249271d

Please sign in to comment.