Skip to content

Commit 0b4af14

Browse files
OskarStarknicolas-grekas
authored andcommitted
Migrate to static data providers using rector/rector
1 parent 4b81c20 commit 0b4af14

30 files changed

+59
-59
lines changed

Tests/ApplicationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExcep
431431
$application->find($abbreviation);
432432
}
433433

434-
public function provideAmbiguousAbbreviations()
434+
public static function provideAmbiguousAbbreviations()
435435
{
436436
return [
437437
['f', 'Command "f" is not defined.'],
@@ -547,7 +547,7 @@ public function testDontRunAlternativeCommandName()
547547
$this->assertStringContainsString('Do you want to run "foo" instead? (yes/no) [no]:', $display);
548548
}
549549

550-
public function provideInvalidCommandNamesSingle()
550+
public static function provideInvalidCommandNamesSingle()
551551
{
552552
return [
553553
['foo3:barr'],
@@ -1239,7 +1239,7 @@ public function testAddingAlreadySetDefinitionElementData($def)
12391239
$application->run($input, $output);
12401240
}
12411241

1242-
public function getAddingAlreadySetDefinitionElementData()
1242+
public static function getAddingAlreadySetDefinitionElementData()
12431243
{
12441244
return [
12451245
[new InputArgument('command', InputArgument::REQUIRED)],

Tests/CI/GithubActionReporterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testAnnotationsFormat(string $type, string $message, string $fil
4343
self::assertSame($expected.\PHP_EOL, $buffer->fetch());
4444
}
4545

46-
public function annotationsFormatProvider(): iterable
46+
public static function annotationsFormatProvider(): iterable
4747
{
4848
yield 'warning' => ['warning', 'A warning', null, null, null, '::warning::A warning'];
4949
yield 'error' => ['error', 'An error', null, null, null, '::error::An error'];

Tests/Command/CommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function testInvalidCommandNames($name)
124124
$command->setName($name);
125125
}
126126

127-
public function provideInvalidCommandNames()
127+
public static function provideInvalidCommandNames()
128128
{
129129
return [
130130
[''],
@@ -338,7 +338,7 @@ public function testSetCode()
338338
$this->assertEquals('interact called'.\PHP_EOL.'from the code...'.\PHP_EOL, $tester->getDisplay());
339339
}
340340

341-
public function getSetCodeBindToClosureTests()
341+
public static function getSetCodeBindToClosureTests()
342342
{
343343
return [
344344
[true, 'not bound to the command'],

Tests/Command/CompleteCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testInputAndCurrentOptionValidation(array $input, ?string $excep
8181
}
8282
}
8383

84-
public function provideInputAndCurrentOptionValues()
84+
public static function provideInputAndCurrentOptionValues()
8585
{
8686
yield [[], 'The "--current" option must be set and it must be an integer'];
8787
yield [['--current' => 'a'], 'The "--current" option must be set and it must be an integer'];
@@ -100,7 +100,7 @@ public function testCompleteCommandName(array $input, array $suggestions)
100100
$this->assertEquals(implode("\n", $suggestions).\PHP_EOL, $this->tester->getDisplay());
101101
}
102102

103-
public function provideCompleteCommandNameInputs()
103+
public static function provideCompleteCommandNameInputs()
104104
{
105105
yield 'empty' => [['bin/console'], ['help', 'list', 'completion', 'hello', 'ahoy']];
106106
yield 'partial' => [['bin/console', 'he'], ['help', 'list', 'completion', 'hello', 'ahoy']];
@@ -117,7 +117,7 @@ public function testCompleteCommandInputDefinition(array $input, array $suggesti
117117
$this->assertEquals(implode("\n", $suggestions).\PHP_EOL, $this->tester->getDisplay());
118118
}
119119

120-
public function provideCompleteCommandInputDefinitionInputs()
120+
public static function provideCompleteCommandInputDefinitionInputs()
121121
{
122122
yield 'definition' => [['bin/console', 'hello', '-'], ['--help', '--quiet', '--verbose', '--version', '--ansi', '--no-ansi', '--no-interaction']];
123123
yield 'custom' => [['bin/console', 'hello'], ['Fabien', 'Robin', 'Wouter']];

Tests/Command/DumpCompletionCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testComplete(array $input, array $expectedSuggestions)
2828
$this->assertSame($expectedSuggestions, $suggestions);
2929
}
3030

31-
public function provideCompletionSuggestions()
31+
public static function provideCompletionSuggestions()
3232
{
3333
yield 'shell' => [
3434
[''],

Tests/Command/HelpCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testComplete(array $input, array $expectedSuggestions)
8383
$this->assertSame($expectedSuggestions, $suggestions);
8484
}
8585

86-
public function provideCompletionSuggestions()
86+
public static function provideCompletionSuggestions()
8787
{
8888
yield 'option --format' => [
8989
['--format', ''],

Tests/Command/ListCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function testComplete(array $input, array $expectedSuggestions)
127127
$this->assertSame($expectedSuggestions, $suggestions);
128128
}
129129

130-
public function provideCompletionSuggestions()
130+
public static function provideCompletionSuggestions()
131131
{
132132
yield 'option --format' => [
133133
['--format', ''],

Tests/Completion/CompletionInputTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testBind(CompletionInput $input, string $expectedType, ?string $
3939
$this->assertEquals($expectedValue, $input->getCompletionValue(), 'Unexpected value');
4040
}
4141

42-
public function provideBindData()
42+
public static function provideBindData()
4343
{
4444
// option names
4545
yield 'optname-minimal-input' => [CompletionInput::fromTokens(['bin/console', '-'], 1), CompletionInput::TYPE_OPTION_NAME, null, '-'];
@@ -90,7 +90,7 @@ public function testBindWithLastArrayArgument(CompletionInput $input, ?string $e
9090
$this->assertEquals($expectedValue, $input->getCompletionValue(), 'Unexpected value');
9191
}
9292

93-
public function provideBindWithLastArrayArgumentData()
93+
public static function provideBindWithLastArrayArgumentData()
9494
{
9595
yield [CompletionInput::fromTokens(['bin/console'], 1), null];
9696
yield [CompletionInput::fromTokens(['bin/console', 'symfony', 'sensiolabs'], 3), null];
@@ -124,7 +124,7 @@ public function testFromString($inputStr, array $expectedTokens)
124124
$this->assertEquals($expectedTokens, $tokensProperty->getValue($input));
125125
}
126126

127-
public function provideFromStringData()
127+
public static function provideFromStringData()
128128
{
129129
yield ['bin/console cache:clear', ['bin/console', 'cache:clear']];
130130
yield ['bin/console --env prod', ['bin/console', '--env', 'prod']];

Tests/DependencyInjection/AddConsoleCommandPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testProcessFallsBackToDefaultName()
112112
$this->assertSame(['new-name' => 'with-default-name'], $container->getDefinition('console.command_loader')->getArgument(1));
113113
}
114114

115-
public function visibilityProvider()
115+
public static function visibilityProvider()
116116
{
117117
return [
118118
[true],

Tests/Descriptor/ApplicationDescriptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testGetNamespaces(array $expected, array $names)
3131
$this->assertSame($expected, array_keys((new ApplicationDescription($application))->getNamespaces()));
3232
}
3333

34-
public function getNamespacesProvider()
34+
public static function getNamespacesProvider()
3535
{
3636
return [
3737
[['_global'], ['foobar']],

0 commit comments

Comments
 (0)