Skip to content

Commit

Permalink
CLI-1192: Symfony 6.3.4 breaks checklists (#1766)
Browse files Browse the repository at this point in the history
* CLI-1192: Update symfony/console

* Fix spinner

* kill mutant
  • Loading branch information
danepowell authored Jul 11, 2024
1 parent 6fbaaa3 commit 153d33c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 57 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"react/event-loop": "^1.1",
"symfony/cache": "^6.3",
"symfony/config": "^6.3",
"symfony/console": "6.3.2",
"symfony/console": "^6.3",
"symfony/dependency-injection": "^6.3",
"symfony/dotenv": "^6.3",
"symfony/event-dispatcher": "^6.3",
Expand Down
118 changes: 66 additions & 52 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Output/Checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function completePreviousItem(): void
$item = $this->getLastItem();
/** @var \Acquia\Cli\Output\Spinner\Spinner $spinner */
$spinner = $item['spinner'];
$spinner->setMessage('', 'detail');
$spinner->setMessage(' ', 'detail');
$spinner->setMessage($item['message']);
$spinner->advance();
$spinner->finish();
Expand Down
2 changes: 1 addition & 1 deletion src/Output/Spinner/Spinner.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function __construct(private OutputInterface $output, private int $indent
$this->progressBar->setEmptyBarCharacter('');
$this->progressBar->setFormat($indentString . "%bar% %message%\n%detail%");
$this->progressBar->setBarWidth(1);
$this->progressBar->setMessage('', 'detail');
$this->progressBar->setMessage(' ', 'detail');
$this->progressBar->setOverwrite($output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Acquia\Cli\Tests\Commands;
namespace Acquia\Cli\Tests\Misc;

use Acquia\Cli\Output\Checklist;
use Acquia\Cli\Tests\TestBase;
Expand All @@ -28,6 +28,9 @@ public function testSpinner(): void
putenv('PHPUNIT_RUNNING=1');
$checklist = new Checklist($this->output);
$checklist->addItem('Testing!');
$items = $checklist->getItems();
$progressBar = $items[0]['spinner']->getProgressBar();
$this->assertEquals(' ', $progressBar->getMessage('detail'));

// Make the spinner spin with some output.
$outputCallback = static function (string $type, string $buffer) use ($checklist): void {
Expand All @@ -48,7 +51,7 @@ public function testSpinner(): void
$this->assertEquals('⢸', $progressBar->getProgressCharacter());
$this->assertEquals('', $progressBar->getEmptyBarCharacter());
$this->assertEquals(1, $progressBar->getBarWidth());
$this->assertEquals('', $progressBar->getMessage('detail'));
$this->assertEquals(' ', $progressBar->getMessage('detail'));

putenv('PHPUNIT_RUNNING');
}
Expand Down

0 comments on commit 153d33c

Please sign in to comment.