From 0b4af1468a8833e902816aeec3a043277db356e0 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 14 Dec 2022 15:42:16 +0100 Subject: [PATCH] Migrate to `static` data providers using `rector/rector` --- Tests/ApplicationTest.php | 6 +++--- Tests/CI/GithubActionReporterTest.php | 2 +- Tests/Command/CommandTest.php | 4 ++-- Tests/Command/CompleteCommandTest.php | 6 +++--- Tests/Command/DumpCompletionCommandTest.php | 2 +- Tests/Command/HelpCommandTest.php | 2 +- Tests/Command/ListCommandTest.php | 2 +- Tests/Completion/CompletionInputTest.php | 6 +++--- .../AddConsoleCommandPassTest.php | 2 +- Tests/Descriptor/ApplicationDescriptionTest.php | 2 +- Tests/Formatter/OutputFormatterTest.php | 4 ++-- Tests/Helper/DumperNativeFallbackTest.php | 2 +- Tests/Helper/DumperTest.php | 2 +- Tests/Helper/HelperTest.php | 4 ++-- Tests/Helper/ProcessHelperTest.php | 2 +- Tests/Helper/ProgressBarTest.php | 2 +- Tests/Helper/ProgressIndicatorTest.php | 2 +- Tests/Helper/QuestionHelperTest.php | 10 +++++----- Tests/Helper/TableTest.php | 6 +++--- Tests/Input/ArgvInputTest.php | 10 +++++----- Tests/Input/ArrayInputTest.php | 4 ++-- Tests/Input/InputDefinitionTest.php | 2 +- Tests/Input/StringInputTest.php | 2 +- Tests/Logger/ConsoleLoggerTest.php | 4 ++-- Tests/Output/OutputTest.php | 4 ++-- Tests/Question/ChoiceQuestionTest.php | 4 ++-- Tests/Question/ConfirmationQuestionTest.php | 2 +- Tests/Question/QuestionTest.php | 12 ++++++------ Tests/Style/SymfonyStyleTest.php | 4 ++-- Tests/Tester/Constraint/CommandIsSuccessfulTest.php | 2 +- 30 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Tests/ApplicationTest.php b/Tests/ApplicationTest.php index d438c3fc9..4e4c032b8 100644 --- a/Tests/ApplicationTest.php +++ b/Tests/ApplicationTest.php @@ -431,7 +431,7 @@ public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExcep $application->find($abbreviation); } - public function provideAmbiguousAbbreviations() + public static function provideAmbiguousAbbreviations() { return [ ['f', 'Command "f" is not defined.'], @@ -547,7 +547,7 @@ public function testDontRunAlternativeCommandName() $this->assertStringContainsString('Do you want to run "foo" instead? (yes/no) [no]:', $display); } - public function provideInvalidCommandNamesSingle() + public static function provideInvalidCommandNamesSingle() { return [ ['foo3:barr'], @@ -1239,7 +1239,7 @@ public function testAddingAlreadySetDefinitionElementData($def) $application->run($input, $output); } - public function getAddingAlreadySetDefinitionElementData() + public static function getAddingAlreadySetDefinitionElementData() { return [ [new InputArgument('command', InputArgument::REQUIRED)], diff --git a/Tests/CI/GithubActionReporterTest.php b/Tests/CI/GithubActionReporterTest.php index 6ef190f16..23f7a3bd9 100644 --- a/Tests/CI/GithubActionReporterTest.php +++ b/Tests/CI/GithubActionReporterTest.php @@ -43,7 +43,7 @@ public function testAnnotationsFormat(string $type, string $message, string $fil self::assertSame($expected.\PHP_EOL, $buffer->fetch()); } - public function annotationsFormatProvider(): iterable + public static function annotationsFormatProvider(): iterable { yield 'warning' => ['warning', 'A warning', null, null, null, '::warning::A warning']; yield 'error' => ['error', 'An error', null, null, null, '::error::An error']; diff --git a/Tests/Command/CommandTest.php b/Tests/Command/CommandTest.php index 81d4b9bba..63a5ea853 100644 --- a/Tests/Command/CommandTest.php +++ b/Tests/Command/CommandTest.php @@ -124,7 +124,7 @@ public function testInvalidCommandNames($name) $command->setName($name); } - public function provideInvalidCommandNames() + public static function provideInvalidCommandNames() { return [ [''], @@ -338,7 +338,7 @@ public function testSetCode() $this->assertEquals('interact called'.\PHP_EOL.'from the code...'.\PHP_EOL, $tester->getDisplay()); } - public function getSetCodeBindToClosureTests() + public static function getSetCodeBindToClosureTests() { return [ [true, 'not bound to the command'], diff --git a/Tests/Command/CompleteCommandTest.php b/Tests/Command/CompleteCommandTest.php index e6c74a736..30b22c967 100644 --- a/Tests/Command/CompleteCommandTest.php +++ b/Tests/Command/CompleteCommandTest.php @@ -81,7 +81,7 @@ public function testInputAndCurrentOptionValidation(array $input, ?string $excep } } - public function provideInputAndCurrentOptionValues() + public static function provideInputAndCurrentOptionValues() { yield [[], 'The "--current" option must be set and it must be an integer']; 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) $this->assertEquals(implode("\n", $suggestions).\PHP_EOL, $this->tester->getDisplay()); } - public function provideCompleteCommandNameInputs() + public static function provideCompleteCommandNameInputs() { yield 'empty' => [['bin/console'], ['help', 'list', 'completion', 'hello', 'ahoy']]; yield 'partial' => [['bin/console', 'he'], ['help', 'list', 'completion', 'hello', 'ahoy']]; @@ -117,7 +117,7 @@ public function testCompleteCommandInputDefinition(array $input, array $suggesti $this->assertEquals(implode("\n", $suggestions).\PHP_EOL, $this->tester->getDisplay()); } - public function provideCompleteCommandInputDefinitionInputs() + public static function provideCompleteCommandInputDefinitionInputs() { yield 'definition' => [['bin/console', 'hello', '-'], ['--help', '--quiet', '--verbose', '--version', '--ansi', '--no-ansi', '--no-interaction']]; yield 'custom' => [['bin/console', 'hello'], ['Fabien', 'Robin', 'Wouter']]; diff --git a/Tests/Command/DumpCompletionCommandTest.php b/Tests/Command/DumpCompletionCommandTest.php index 21df42873..8d0fb4553 100644 --- a/Tests/Command/DumpCompletionCommandTest.php +++ b/Tests/Command/DumpCompletionCommandTest.php @@ -28,7 +28,7 @@ public function testComplete(array $input, array $expectedSuggestions) $this->assertSame($expectedSuggestions, $suggestions); } - public function provideCompletionSuggestions() + public static function provideCompletionSuggestions() { yield 'shell' => [ [''], diff --git a/Tests/Command/HelpCommandTest.php b/Tests/Command/HelpCommandTest.php index 0e8a7f4f7..d61c912fc 100644 --- a/Tests/Command/HelpCommandTest.php +++ b/Tests/Command/HelpCommandTest.php @@ -83,7 +83,7 @@ public function testComplete(array $input, array $expectedSuggestions) $this->assertSame($expectedSuggestions, $suggestions); } - public function provideCompletionSuggestions() + public static function provideCompletionSuggestions() { yield 'option --format' => [ ['--format', ''], diff --git a/Tests/Command/ListCommandTest.php b/Tests/Command/ListCommandTest.php index 0f78cf7ee..7ed9d3d5d 100644 --- a/Tests/Command/ListCommandTest.php +++ b/Tests/Command/ListCommandTest.php @@ -127,7 +127,7 @@ public function testComplete(array $input, array $expectedSuggestions) $this->assertSame($expectedSuggestions, $suggestions); } - public function provideCompletionSuggestions() + public static function provideCompletionSuggestions() { yield 'option --format' => [ ['--format', ''], diff --git a/Tests/Completion/CompletionInputTest.php b/Tests/Completion/CompletionInputTest.php index ee370076c..d98da682c 100644 --- a/Tests/Completion/CompletionInputTest.php +++ b/Tests/Completion/CompletionInputTest.php @@ -39,7 +39,7 @@ public function testBind(CompletionInput $input, string $expectedType, ?string $ $this->assertEquals($expectedValue, $input->getCompletionValue(), 'Unexpected value'); } - public function provideBindData() + public static function provideBindData() { // option names 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 $this->assertEquals($expectedValue, $input->getCompletionValue(), 'Unexpected value'); } - public function provideBindWithLastArrayArgumentData() + public static function provideBindWithLastArrayArgumentData() { yield [CompletionInput::fromTokens(['bin/console'], 1), null]; yield [CompletionInput::fromTokens(['bin/console', 'symfony', 'sensiolabs'], 3), null]; @@ -124,7 +124,7 @@ public function testFromString($inputStr, array $expectedTokens) $this->assertEquals($expectedTokens, $tokensProperty->getValue($input)); } - public function provideFromStringData() + public static function provideFromStringData() { yield ['bin/console cache:clear', ['bin/console', 'cache:clear']]; yield ['bin/console --env prod', ['bin/console', '--env', 'prod']]; diff --git a/Tests/DependencyInjection/AddConsoleCommandPassTest.php b/Tests/DependencyInjection/AddConsoleCommandPassTest.php index eec4eff43..1556617fb 100644 --- a/Tests/DependencyInjection/AddConsoleCommandPassTest.php +++ b/Tests/DependencyInjection/AddConsoleCommandPassTest.php @@ -112,7 +112,7 @@ public function testProcessFallsBackToDefaultName() $this->assertSame(['new-name' => 'with-default-name'], $container->getDefinition('console.command_loader')->getArgument(1)); } - public function visibilityProvider() + public static function visibilityProvider() { return [ [true], diff --git a/Tests/Descriptor/ApplicationDescriptionTest.php b/Tests/Descriptor/ApplicationDescriptionTest.php index da64dca00..989521ebb 100644 --- a/Tests/Descriptor/ApplicationDescriptionTest.php +++ b/Tests/Descriptor/ApplicationDescriptionTest.php @@ -31,7 +31,7 @@ public function testGetNamespaces(array $expected, array $names) $this->assertSame($expected, array_keys((new ApplicationDescription($application))->getNamespaces())); } - public function getNamespacesProvider() + public static function getNamespacesProvider() { return [ [['_global'], ['foobar']], diff --git a/Tests/Formatter/OutputFormatterTest.php b/Tests/Formatter/OutputFormatterTest.php index c6d2184e9..84eb8d87f 100644 --- a/Tests/Formatter/OutputFormatterTest.php +++ b/Tests/Formatter/OutputFormatterTest.php @@ -185,7 +185,7 @@ public function testInlineStyleOptions(string $tag, string $expected = null, str } } - public function provideInlineStyleOptionsCases() + public static function provideInlineStyleOptionsCases() { return [ [''], @@ -258,7 +258,7 @@ public function testNotDecoratedFormatter(string $input, string $expectedNonDeco } } - public function provideDecoratedAndNonDecoratedOutput() + public static function provideDecoratedAndNonDecoratedOutput() { return [ ['some error', 'some error', "\033[37;41msome error\033[39;49m"], diff --git a/Tests/Helper/DumperNativeFallbackTest.php b/Tests/Helper/DumperNativeFallbackTest.php index 906d322b6..1b37e4e93 100644 --- a/Tests/Helper/DumperNativeFallbackTest.php +++ b/Tests/Helper/DumperNativeFallbackTest.php @@ -42,7 +42,7 @@ public function testInvoke($variable, $primitiveString) $this->assertSame($primitiveString, $dumper($variable)); } - public function provideVariables() + public static function provideVariables() { return [ [null, 'null'], diff --git a/Tests/Helper/DumperTest.php b/Tests/Helper/DumperTest.php index e491422b0..0a30c6ec3 100644 --- a/Tests/Helper/DumperTest.php +++ b/Tests/Helper/DumperTest.php @@ -45,7 +45,7 @@ public function testInvoke($variable) $this->assertDumpMatchesFormat($dumper($variable), $variable); } - public function provideVariables() + public static function provideVariables() { return [ [null], diff --git a/Tests/Helper/HelperTest.php b/Tests/Helper/HelperTest.php index b8c891087..9f59aa2ff 100644 --- a/Tests/Helper/HelperTest.php +++ b/Tests/Helper/HelperTest.php @@ -17,7 +17,7 @@ class HelperTest extends TestCase { - public function formatTimeProvider() + public static function formatTimeProvider() { return [ [0, '< 1 sec'], @@ -43,7 +43,7 @@ public function formatTimeProvider() ]; } - public function decoratedTextProvider() + public static function decoratedTextProvider() { return [ ['abc', 'abc'], diff --git a/Tests/Helper/ProcessHelperTest.php b/Tests/Helper/ProcessHelperTest.php index e2880f22f..b4d7b0bbc 100644 --- a/Tests/Helper/ProcessHelperTest.php +++ b/Tests/Helper/ProcessHelperTest.php @@ -49,7 +49,7 @@ public function testPassedCallbackIsExecuted() $this->assertTrue($executed); } - public function provideCommandsAndOutput() + public static function provideCommandsAndOutput() { $successOutputVerbose = <<<'EOT' RUN php -r "echo 42;" diff --git a/Tests/Helper/ProgressBarTest.php b/Tests/Helper/ProgressBarTest.php index c9b9c9d53..a0c6ee129 100644 --- a/Tests/Helper/ProgressBarTest.php +++ b/Tests/Helper/ProgressBarTest.php @@ -954,7 +954,7 @@ public function testFormatsWithoutMax($format) /** * Provides each defined format. */ - public function provideFormat(): array + public static function provideFormat(): array { return [ ['normal'], diff --git a/Tests/Helper/ProgressIndicatorTest.php b/Tests/Helper/ProgressIndicatorTest.php index cd97d406e..ffb3472ec 100644 --- a/Tests/Helper/ProgressIndicatorTest.php +++ b/Tests/Helper/ProgressIndicatorTest.php @@ -158,7 +158,7 @@ public function testFormats($format) /** * Provides each defined format. */ - public function provideFormat(): array + public static function provideFormat(): array { return [ ['normal'], diff --git a/Tests/Helper/QuestionHelperTest.php b/Tests/Helper/QuestionHelperTest.php index d9aef3365..9761e8f97 100644 --- a/Tests/Helper/QuestionHelperTest.php +++ b/Tests/Helper/QuestionHelperTest.php @@ -340,7 +340,7 @@ public function testAskWithAutocompleteWithExactMatch() $this->assertSame('b', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question)); } - public function getInputs() + public static function getInputs() { return [ ['$'], // 1 byte character @@ -536,7 +536,7 @@ public function testAskConfirmation($question, $expected, $default = true) $this->assertEquals($expected, $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel')); } - public function getAskConfirmationData() + public static function getAskConfirmationData() { return [ ['', true], @@ -612,7 +612,7 @@ public function testSelectChoiceFromSimpleChoices($providedAnswer, $expectedValu $this->assertSame($expectedValue, $answer); } - public function simpleAnswerProvider() + public static function simpleAnswerProvider() { return [ [0, 'My environment 1'], @@ -647,7 +647,7 @@ public function testSpecialCharacterChoiceFromMultipleChoiceList($providedAnswer $this->assertSame($expectedValue, $answer); } - public function specialCharacterInMultipleChoice() + public static function specialCharacterInMultipleChoice() { return [ ['.', ['.']], @@ -697,7 +697,7 @@ public function testAmbiguousChoiceFromChoicelist() $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("My environment\n")), $this->createOutputInterface(), $question); } - public function answerProvider() + public static function answerProvider() { return [ ['env_1', 'env_1'], diff --git a/Tests/Helper/TableTest.php b/Tests/Helper/TableTest.php index 2d70bd271..d10289c66 100644 --- a/Tests/Helper/TableTest.php +++ b/Tests/Helper/TableTest.php @@ -88,7 +88,7 @@ public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $d $this->assertEquals($expected, $this->getOutputContent($output)); } - public function renderProvider() + public static function renderProvider() { $books = [ ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'], @@ -1268,7 +1268,7 @@ public function testSetTitle($headerTitle, $footerTitle, $style, $expected) $this->assertEquals($expected, $this->getOutputContent($output)); } - public function renderSetTitle() + public static function renderSetTitle() { return [ [ @@ -1481,7 +1481,7 @@ public function testBoxedStyleWithColspan() $this->assertSame($expected, $this->getOutputContent($output)); } - public function provideRenderHorizontalTests() + public static function provideRenderHorizontalTests() { $headers = ['foo', 'bar', 'baz']; $rows = [['one', 'two', 'tree'], ['1', '2', '3']]; diff --git a/Tests/Input/ArgvInputTest.php b/Tests/Input/ArgvInputTest.php index 233333270..b5289fa01 100644 --- a/Tests/Input/ArgvInputTest.php +++ b/Tests/Input/ArgvInputTest.php @@ -61,7 +61,7 @@ public function testParseOptionsNegatable($input, $options, $expectedOptions, $m $this->assertEquals($expectedOptions, $input->getOptions(), $message); } - public function provideOptions() + public static function provideOptions() { return [ [ @@ -187,7 +187,7 @@ public function provideOptions() ]; } - public function provideNegatableOptions() + public static function provideNegatableOptions() { return [ [ @@ -259,7 +259,7 @@ public function testInvalidInputNegatable($argv, $definition, $expectedException $input->bind($definition); } - public function provideInvalidInput() + public static function provideInvalidInput() { return [ [ @@ -330,7 +330,7 @@ public function provideInvalidInput() ]; } - public function provideInvalidNegatableInput() + public static function provideInvalidNegatableInput() { return [ [ @@ -516,7 +516,7 @@ public function testGetParameterOptionEqualSign($argv, $key, $default, $onlyPara $this->assertEquals($expected, $input->getParameterOption($key, $default, $onlyParams), '->getParameterOption() returns the expected value'); } - public function provideGetParameterOptionValues() + public static function provideGetParameterOptionValues() { return [ [['app/console', 'foo:bar'], '-e', 'default', false, 'default'], diff --git a/Tests/Input/ArrayInputTest.php b/Tests/Input/ArrayInputTest.php index 5777c44b7..733322490 100644 --- a/Tests/Input/ArrayInputTest.php +++ b/Tests/Input/ArrayInputTest.php @@ -74,7 +74,7 @@ public function testParseOptions($input, $options, $expectedOptions, $message) $this->assertEquals($expectedOptions, $input->getOptions(), $message); } - public function provideOptions() + public static function provideOptions() { return [ [ @@ -133,7 +133,7 @@ public function testParseInvalidInput($parameters, $definition, $expectedExcepti new ArrayInput($parameters, $definition); } - public function provideInvalidInput() + public static function provideInvalidInput() { return [ [ diff --git a/Tests/Input/InputDefinitionTest.php b/Tests/Input/InputDefinitionTest.php index 11c6ae165..39157af8f 100644 --- a/Tests/Input/InputDefinitionTest.php +++ b/Tests/Input/InputDefinitionTest.php @@ -367,7 +367,7 @@ public function testGetSynopsis(InputDefinition $definition, $expectedSynopsis, $this->assertEquals($expectedSynopsis, $definition->getSynopsis(), $message ? '->getSynopsis() '.$message : ''); } - public function getGetSynopsisData() + public static function getGetSynopsisData() { return [ [new InputDefinition([new InputOption('foo')]), '[--foo]', 'puts optional options in square brackets'], diff --git a/Tests/Input/StringInputTest.php b/Tests/Input/StringInputTest.php index 2bd40dec9..c55256c03 100644 --- a/Tests/Input/StringInputTest.php +++ b/Tests/Input/StringInputTest.php @@ -43,7 +43,7 @@ public function testInputOptionWithGivenString() $this->assertEquals('bar', $input->getOption('foo')); } - public function getTokenizeData() + public static function getTokenizeData() { return [ ['', [], '->tokenize() parses an empty string'], diff --git a/Tests/Logger/ConsoleLoggerTest.php b/Tests/Logger/ConsoleLoggerTest.php index 3585bde63..4a96ddb15 100644 --- a/Tests/Logger/ConsoleLoggerTest.php +++ b/Tests/Logger/ConsoleLoggerTest.php @@ -69,7 +69,7 @@ public function testOutputMapping($logLevel, $outputVerbosity, $isOutput, $addVe $this->assertEquals($isOutput ? "[$logLevel] foo bar".\PHP_EOL : '', $logs); } - public function provideOutputMappingParams() + public static function provideOutputMappingParams() { $quietMap = [LogLevel::EMERGENCY => OutputInterface::VERBOSITY_QUIET]; @@ -123,7 +123,7 @@ public function testLogsAtAllLevels($level, $message) $this->assertEquals($expected, $this->getLogs()); } - public function provideLevelsAndMessages() + public static function provideLevelsAndMessages() { return [ LogLevel::EMERGENCY => [LogLevel::EMERGENCY, 'message of level emergency with context: {user}'], diff --git a/Tests/Output/OutputTest.php b/Tests/Output/OutputTest.php index 330064973..f337c4ddd 100644 --- a/Tests/Output/OutputTest.php +++ b/Tests/Output/OutputTest.php @@ -104,7 +104,7 @@ public function testWriteRawMessage($message, $type, $expectedOutput) $this->assertEquals($expectedOutput, $output->output); } - public function provideWriteArguments() + public static function provideWriteArguments() { return [ ['foo', Output::OUTPUT_RAW, "foo\n"], @@ -161,7 +161,7 @@ public function testWriteWithVerbosityOption($verbosity, $expected, $msg) $this->assertEquals($expected, $output->output, $msg); } - public function verbosityProvider() + public static function verbosityProvider() { return [ [Output::VERBOSITY_QUIET, '2', '->write() in QUIET mode only outputs when an explicit QUIET verbosity is passed'], diff --git a/Tests/Question/ChoiceQuestionTest.php b/Tests/Question/ChoiceQuestionTest.php index a7a2dfba4..d8b1f10ec 100644 --- a/Tests/Question/ChoiceQuestionTest.php +++ b/Tests/Question/ChoiceQuestionTest.php @@ -39,7 +39,7 @@ public function testSelectUseCases($multiSelect, $answers, $expected, $message, } } - public function selectUseCases() + public static function selectUseCases() { return [ [ @@ -119,7 +119,7 @@ public function testSelectAssociativeChoices($providedAnswer, $expectedValue) $this->assertSame($expectedValue, $question->getValidator()($providedAnswer)); } - public function selectAssociativeChoicesProvider() + public static function selectAssociativeChoicesProvider() { return [ 'select "0" choice by key' => ['0', '0'], diff --git a/Tests/Question/ConfirmationQuestionTest.php b/Tests/Question/ConfirmationQuestionTest.php index 83899772a..44f4c870b 100644 --- a/Tests/Question/ConfirmationQuestionTest.php +++ b/Tests/Question/ConfirmationQuestionTest.php @@ -30,7 +30,7 @@ public function testDefaultRegexUsecases($default, $answers, $expected, $message } } - public function normalizerUsecases() + public static function normalizerUsecases() { return [ [ diff --git a/Tests/Question/QuestionTest.php b/Tests/Question/QuestionTest.php index 55e9d58d4..e6b6fbee0 100644 --- a/Tests/Question/QuestionTest.php +++ b/Tests/Question/QuestionTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $this->question = new Question('Test question'); } - public function providerTrueFalse() + public static function providerTrueFalse() { return [[true], [false]]; } @@ -104,7 +104,7 @@ public function testIsHiddenFallbackDefault() self::assertTrue($this->question->isHiddenFallback()); } - public function providerGetSetAutocompleterValues() + public static function providerGetSetAutocompleterValues() { return [ 'array' => [ @@ -135,7 +135,7 @@ public function testGetSetAutocompleterValues($values, $expectValues) ); } - public function providerSetAutocompleterValuesInvalid() + public static function providerSetAutocompleterValuesInvalid() { return [ ['Potato'], @@ -229,7 +229,7 @@ function (string $input): array { return []; } $this->assertNull($exception); } - public function providerGetSetValidator() + public static function providerGetSetValidator() { return [ [function ($input) { return $input; }], @@ -251,7 +251,7 @@ public function testGetValidatorDefault() self::assertNull($this->question->getValidator()); } - public function providerGetSetMaxAttempts() + public static function providerGetSetMaxAttempts() { return [[1], [5], [null]]; } @@ -265,7 +265,7 @@ public function testGetSetMaxAttempts($attempts) self::assertSame($attempts, $this->question->getMaxAttempts()); } - public function providerSetMaxAttemptsInvalid() + public static function providerSetMaxAttemptsInvalid() { return [[0], [-1]]; } diff --git a/Tests/Style/SymfonyStyleTest.php b/Tests/Style/SymfonyStyleTest.php index 74c240340..2edbcdfab 100644 --- a/Tests/Style/SymfonyStyleTest.php +++ b/Tests/Style/SymfonyStyleTest.php @@ -69,14 +69,14 @@ public function testInteractiveOutputs($inputCommandFilepath, $outputFilepath) $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true)); } - public function inputInteractiveCommandToOutputFilesProvider() + public static function inputInteractiveCommandToOutputFilesProvider() { $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle'; return array_map(null, glob($baseDir.'/command/interactive_command_*.php'), glob($baseDir.'/output/interactive_output_*.txt')); } - public function inputCommandToOutputFilesProvider() + public static function inputCommandToOutputFilesProvider() { $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle'; diff --git a/Tests/Tester/Constraint/CommandIsSuccessfulTest.php b/Tests/Tester/Constraint/CommandIsSuccessfulTest.php index 2de8ac345..7a2b4c719 100644 --- a/Tests/Tester/Constraint/CommandIsSuccessfulTest.php +++ b/Tests/Tester/Constraint/CommandIsSuccessfulTest.php @@ -47,7 +47,7 @@ public function testUnsuccessfulCommand(string $expectedException, int $exitCode $this->fail(); } - public function providesUnsuccessful(): iterable + public static function providesUnsuccessful(): iterable { yield 'Failed' => ['Command failed.', Command::FAILURE]; yield 'Invalid' => ['Command was invalid.', Command::INVALID];