From 415e019d776d8feec6fdf0b9fa0500a002e889ae Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 6 Mar 2021 13:53:20 +0100 Subject: [PATCH 1/3] [Console] Fix tests --- .../Tests/Security/User/EntityUserProviderTest.php | 3 +++ .../Tests/Console/ApplicationTest.php | 2 +- src/Symfony/Bundle/FrameworkBundle/composer.json | 4 ++-- .../Console/Tests/Command/ListCommandTest.php | 14 +++++++------- .../Console/Tests/Fixtures/application_1.json | 4 ++-- .../Console/Tests/Fixtures/application_1.md | 4 ++-- .../Console/Tests/Fixtures/application_1.txt | 4 ++-- .../Console/Tests/Fixtures/application_1.xml | 4 ++-- .../Console/Tests/Fixtures/application_2.json | 4 ++-- .../Console/Tests/Fixtures/application_2.md | 4 ++-- .../Console/Tests/Fixtures/application_2.txt | 4 ++-- .../Console/Tests/Fixtures/application_2.xml | 4 ++-- .../Console/Tests/Fixtures/application_mbstring.md | 4 ++-- .../Tests/Fixtures/application_mbstring.txt | 4 ++-- .../Console/Tests/Fixtures/application_run1.txt | 4 ++-- .../Console/Tests/Fixtures/application_run2.txt | 2 +- .../Console/Tests/Fixtures/application_run3.txt | 2 +- 17 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index 4991445456..845515b901 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -234,4 +234,7 @@ abstract class UserLoaderRepository implements ObjectRepository, UserLoaderInter abstract class PasswordUpgraderRepository implements ObjectRepository, PasswordUpgraderInterface { + public function upgradePassword(UserInterface $user, string $newEncodedPassword): void + { + } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php index f7c66c50d0..447d2afb04 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php @@ -229,7 +229,7 @@ class ApplicationTest extends TestCase $tester->run(['command' => 'list']); $this->assertSame(0, $tester->getStatusCode()); - $display = explode('Lists commands', $tester->getDisplay()); + $display = explode('List commands', $tester->getDisplay()); $this->assertStringContainsString(trim('[WARNING] Some commands could not be registered:'), trim($display[1])); } diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index f592065b28..f26298324f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -36,7 +36,7 @@ "paragonie/sodium_compat": "^1.8", "symfony/asset": "^3.4|^4.0|^5.0", "symfony/browser-kit": "^4.3|^5.0", - "symfony/console": "^4.3.4|^5.0", + "symfony/console": "^4.4.21|^5.0", "symfony/css-selector": "^3.4|^4.0|^5.0", "symfony/dom-crawler": "^4.3|^5.0", "symfony/dotenv": "^4.3.6|^5.0", @@ -72,7 +72,7 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "symfony/asset": "<3.4", "symfony/browser-kit": "<4.3", - "symfony/console": "<4.3", + "symfony/console": "<4.4.21", "symfony/dotenv": "<4.3.6", "symfony/dom-crawler": "<4.3", "symfony/http-client": "<4.4", diff --git a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php index 3908ca5bb2..7269b39fe9 100644 --- a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php @@ -23,7 +23,7 @@ class ListCommandTest extends TestCase $commandTester = new CommandTester($command = $application->get('list')); $commandTester->execute(['command' => $command->getName()], ['decorated' => false]); - $this->assertMatchesRegularExpression('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); + $this->assertMatchesRegularExpression('/help\s{2,}Display help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); } public function testExecuteListsCommandsWithXmlOption() @@ -40,8 +40,8 @@ class ListCommandTest extends TestCase $commandTester = new CommandTester($command = $application->get('list')); $commandTester->execute(['command' => $command->getName(), '--raw' => true]); $output = <<<'EOF' -help Displays help for a command -list Lists commands +help Display help for a command +list List commands EOF; @@ -86,8 +86,8 @@ Options: -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: - help Displays help for a command - list Lists commands + help Display help for a command + list List commands 0foo 0foo:bar 0foo:bar command EOF; @@ -103,8 +103,8 @@ EOF; $commandTester = new CommandTester($command = $application->get('list')); $commandTester->execute(['command' => $command->getName(), '--raw' => true]); $output = <<<'EOF' -help Displays help for a command -list Lists commands +help Display help for a command +list List commands 0foo:bar 0foo:bar command EOF; diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json index 29faa8262d..230b072b06 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json @@ -6,7 +6,7 @@ "usage": [ "help [--format FORMAT] [--raw] [--] []" ], - "description": "Displays help for a command", + "description": "Display help for a command", "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.", "definition": { "arguments": { @@ -109,7 +109,7 @@ "usage": [ "list [--raw] [--format FORMAT] [--] []" ], - "description": "Lists commands", + "description": "List commands", "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>", "definition": { "arguments": { diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md index b46c975a79..63822d037f 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -7,7 +7,7 @@ Console Tool `help` ------ -Displays help for a command +Display help for a command ### Usage @@ -119,7 +119,7 @@ Do not ask any interactive question `list` ------ -Lists commands +List commands ### Usage diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt index 8a7b47e0c4..ab345e65c6 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt @@ -13,5 +13,5 @@ Console Tool -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: - help Displays help for a command - list Lists commands + help Display help for a command + list List commands diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml index a0bd076c5a..f47bfb23b7 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml @@ -5,7 +5,7 @@ help [--format FORMAT] [--raw] [--] [<command_name>] - Displays help for a command + Display help for a command The <info>help</info> command displays help for a given command: <info>php app/console help list</info> @@ -60,7 +60,7 @@ list [--raw] [--format FORMAT] [--] [<namespace>] - Lists commands + List commands The <info>list</info> command lists all commands: <info>php app/console list</info> diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json index 4777a60b52..f47267ab4e 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json @@ -10,7 +10,7 @@ "usage": [ "help [--format FORMAT] [--raw] [--] []" ], - "description": "Displays help for a command", + "description": "Display help for a command", "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.", "definition": { "arguments": { @@ -113,7 +113,7 @@ "usage": [ "list [--raw] [--format FORMAT] [--] []" ], - "description": "Lists commands", + "description": "List commands", "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>", "definition": { "arguments": { diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md index 5b4896c082..77c1dc523c 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md @@ -20,7 +20,7 @@ My Symfony application v1.0 `help` ------ -Displays help for a command +Display help for a command ### Usage @@ -132,7 +132,7 @@ Do not ask any interactive question `list` ------ -Lists commands +List commands ### Usage diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt index d624f19466..3d605c838c 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt @@ -13,8 +13,8 @@ My Symfony application v1.0 -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: - help Displays help for a command - list Lists commands + help Display help for a command + list List commands descriptor descriptor:command1 [alias1|alias2] command 1 description descriptor:command2 command 2 description diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml b/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml index 5f0f98bd9f..27e5f48241 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml @@ -5,7 +5,7 @@ help [--format FORMAT] [--raw] [--] [<command_name>] - Displays help for a command + Display help for a command The <info>help</info> command displays help for a given command: <info>php app/console help list</info> @@ -60,7 +60,7 @@ list [--raw] [--format FORMAT] [--] [<namespace>] - Lists commands + List commands The <info>list</info> command lists all commands: <info>php app/console list</info> diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md index f34e5585cf..e3f43aff5c 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md @@ -11,7 +11,7 @@ MbString åpplicätion `help` ------ -Displays help for a command +Display help for a command ### Usage @@ -123,7 +123,7 @@ Do not ask any interactive question `list` ------ -Lists commands +List commands ### Usage diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt index b409d18816..8091bedd30 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.txt @@ -13,7 +13,7 @@ MbString åpplicätion -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: - help Displays help for a command - list Lists commands + help Display help for a command + list List commands descriptor descriptor:åèä command åèä description diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt index 0dc2730983..c95d282f29 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt @@ -13,5 +13,5 @@ Options: -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: - help Displays help for a command - list Lists commands + help Display help for a command + list List commands diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt index 90050b0544..d6e45b6521 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt @@ -1,5 +1,5 @@ Description: - Lists commands + List commands Usage: list [options] [--] [] diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt index 90050b0544..d6e45b6521 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt @@ -1,5 +1,5 @@ Description: - Lists commands + List commands Usage: list [options] [--] [] From 04cb83e1f9331493c515313675e6700f37bda8dc Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 6 Mar 2021 14:42:15 +0100 Subject: [PATCH 2/3] fix test --- .../Component/Console/Tests/Fixtures/application_run5.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run5.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run5.txt index 1cf8d1f8b6..d4bc28e1db 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run5.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run5.txt @@ -1,5 +1,5 @@ Description: - Displays help for a command + Display help for a command Usage: help [options] [--] [] From 7bc31c64f294c29cfce0c24d9bf0a99eea60ad97 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 6 Mar 2021 14:47:01 +0100 Subject: [PATCH 3/3] [Security] Fix test --- .../Tests/EventListener/PasswordMigratingListenerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Http/Tests/EventListener/PasswordMigratingListenerTest.php b/src/Symfony/Component/Security/Http/Tests/EventListener/PasswordMigratingListenerTest.php index 39a62e0f69..dea08f0186 100644 --- a/src/Symfony/Component/Security/Http/Tests/EventListener/PasswordMigratingListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/EventListener/PasswordMigratingListenerTest.php @@ -110,7 +110,7 @@ class PasswordMigratingListenerTest extends TestCase private function createPasswordUpgrader() { - return $this->createMock(PasswordUpgraderInterface::class); + return $this->createMock(MigratingUserProvider::class); } private function createEvent(PassportInterface $passport) @@ -121,4 +121,7 @@ class PasswordMigratingListenerTest extends TestCase abstract class MigratingUserProvider implements UserProviderInterface, PasswordUpgraderInterface { + public function upgradePassword(UserInterface $user, string $newEncodedPassword): void + { + } }