Skip to content

Commit

Permalink
fixup! [Console] Add missing assertCommandIsFaulty assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed Nov 7, 2023
1 parent ed57c3c commit 09a7b78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG-6.4.md
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/CHANGELOG.md
Expand Up @@ -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)`
Expand Down
Expand Up @@ -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);
}
}
Expand Up @@ -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()
Expand Down

0 comments on commit 09a7b78

Please sign in to comment.