diff --git a/CHANGELOG-6.4.md b/CHANGELOG-6.4.md index 1564e9e7f9431..f93f009930604 100644 --- a/CHANGELOG-6.4.md +++ b/CHANGELOG-6.4.md @@ -7,9 +7,6 @@ in 6.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.4.0...v6.4.1 -* 6.4.0-BETA3 - * feature #52478 [Console] Add missing assertCommandIsFaulty assertion (raphaelstolt) - * 6.4.0-BETA2 (2023-10-29) * bug #52329 [HttpClient] Psr18Client: parse HTTP Reason Phrase for Response (Hanmac) diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 9ccb41d945792..e9c0dc620c260 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -3,7 +3,7 @@ CHANGELOG 6.4 --- - + * Add missing `assertCommandIsFaulty` assertion * Add `SignalMap` to map signal value to its name * Multi-line text in vertical tables is aligned properly * The application can also catch errors with `Application::setCatchErrors(true)` diff --git a/src/Symfony/Component/Console/Tester/Constraint/CommandIsFaulty.php b/src/Symfony/Component/Console/Tester/Constraint/CommandIsFaulty.php index 3df4fbf25f09c..1ca71346944e1 100644 --- a/src/Symfony/Component/Console/Tester/Constraint/CommandIsFaulty.php +++ b/src/Symfony/Component/Console/Tester/Constraint/CommandIsFaulty.php @@ -33,10 +33,8 @@ protected function failureDescription($other): string protected function additionalFailureDescription($other): string { - $mapping = [ - Command::SUCCESS => 'Command was successful.' - ]; - - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); + return Command::SUCCESS === $other + ? 'Command was successful.' + : sprintf('Command returned exit status %d.', $other); } } diff --git a/src/Symfony/Component/Console/Tests/CommandIsFaultyTest.php b/src/Symfony/Component/Console/Tests/Tester/Constraint/CommandIsFaultyTest.php similarity index 91% rename from src/Symfony/Component/Console/Tests/CommandIsFaultyTest.php rename to src/Symfony/Component/Console/Tests/Tester/Constraint/CommandIsFaultyTest.php index 709ef8094d0d4..77913ecdac04f 100644 --- a/src/Symfony/Component/Console/Tests/CommandIsFaultyTest.php +++ b/src/Symfony/Component/Console/Tests/Tester/Constraint/CommandIsFaultyTest.php @@ -23,9 +23,9 @@ public function testConstraint() { $constraint = new CommandIsFaulty(); - $this->assertFalse($constraint->evaluate(Command::SUCCESS, '', true)); - $this->assertTrue($constraint->evaluate(Command::FAILURE, '', true)); - $this->assertTrue($constraint->evaluate(Command::INVALID, '', true)); + $this->assertFalse($constraint->evaluate(Command::SUCCESS, returnResult: true)); + $this->assertTrue($constraint->evaluate(Command::FAILURE, returnResult: true)); + $this->assertTrue($constraint->evaluate(Command::INVALID, returnResult: true)); } public function testSuccessfulCommand()