diff --git a/src/Output/Checklist.php b/src/Output/Checklist.php index da0e3759a..b586c499e 100644 --- a/src/Output/Checklist.php +++ b/src/Output/Checklist.php @@ -52,7 +52,7 @@ private function getLastItem(): mixed { return end($this->items); } - public function updateProgressBar(mixed $updateMessage): void { + public function updateProgressBar(string $updateMessage): void { $item = $this->getLastItem(); if (!$item) { return; diff --git a/tests/phpunit/src/Commands/ChecklistTest.php b/tests/phpunit/src/Commands/ChecklistTest.php index 8150e13ae..c1c203449 100644 --- a/tests/phpunit/src/Commands/ChecklistTest.php +++ b/tests/phpunit/src/Commands/ChecklistTest.php @@ -28,7 +28,7 @@ public function testSpinner(): void { $checklist->addItem('Testing!'); // Make the spinner spin with some output. - $outputCallback = static function (mixed $type, mixed $buffer) use ($checklist): void { + $outputCallback = static function (string $type, string $buffer) use ($checklist): void { $checklist->updateProgressBar($buffer); }; $this->localMachineHelper->execute(['echo', 'hello world'], $outputCallback, NULL, FALSE); @@ -39,6 +39,11 @@ public function testSpinner(): void { /** @var \Symfony\Component\Console\Helper\ProgressBar $progressBar */ $progressBar = $items[0]['spinner']->getProgressBar(); $this->assertEquals('Testing!', $progressBar->getMessage()); + $this->assertEquals('', $progressBar->getBarCharacter()); + $this->assertEquals('⢸', $progressBar->getProgressCharacter()); + $this->assertEquals('⌛', $progressBar->getEmptyBarCharacter()); + $this->assertEquals(1, $progressBar->getBarWidth()); + $this->assertEquals('', $progressBar->getMessage('detail')); putenv('PHPUNIT_RUNNING'); }