From f8c9e6ed4b8c018bbc012438130fa915e09bcd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Sun, 7 Apr 2024 20:44:52 +0200 Subject: [PATCH] ListCommand: explain is more #colorful and space-y --- src/Command/ListCommand.php | 3 ++- tests/Unit/Command/ListCommandTest.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Command/ListCommand.php b/src/Command/ListCommand.php index 61513ed..9d9e03f 100644 --- a/src/Command/ListCommand.php +++ b/src/Command/ListCommand.php @@ -162,7 +162,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $explain, ); - $output->writeln(' ' . $explainedExpression); + $output->writeln(" $explainedExpression"); + $output->writeln(''); } } diff --git a/tests/Unit/Command/ListCommandTest.php b/tests/Unit/Command/ListCommandTest.php index 8907c44..33c5216 100644 --- a/tests/Unit/Command/ListCommandTest.php +++ b/tests/Unit/Command/ListCommandTest.php @@ -449,13 +449,17 @@ public function testExplain(): void self::assertSame( $explainDefault = <<<'MSG' * * * * * [0] Tests\Orisai\Scheduler\Doubles\CallbackList::job1() Next Due: 59 seconds - At every minute. + At every minute. + */30 7-15 * * 1-5 (America/New_York) [1] Tests\Orisai\Scheduler\Doubles\CallbackList::job1() Next Due: 5 hours - At every 30th minute past every hour from 7 through 15 on every day-of-week from Monday through Friday in America/New_York time zone. + At every 30th minute past every hour from 7 through 15 on every day-of-week from Monday through Friday in America/New_York time zone. + * * * 4 * / 10 [2] Tests\Orisai\Scheduler\Doubles\CallbackList::__invoke() Next Due: 2 months - At every 10 seconds in April. + At every 10 seconds in April. + * * * 3 * / 15 (America/New_York) [3] Tests\Orisai\Scheduler\Doubles\CallbackList::__invoke() Next Due: 1 month - At every 15 seconds in March in America/New_York time zone. + At every 15 seconds in March in America/New_York time zone. + MSG, CommandOutputHelper::getCommandOutput($tester),