From 1d04a917947d8e8e645ce4461dcd827264f67726 Mon Sep 17 00:00:00 2001 From: Francisco Madeira Date: Thu, 20 Jul 2023 16:13:47 +0100 Subject: [PATCH] Add missing tests for the `schedule:list` Command. (#47787) --- .../Scheduling/ScheduleListCommandTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php index dae9de4a375a..83c98f525d34 100644 --- a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php @@ -108,6 +108,27 @@ public function testDisplayScheduleInVerboseMode() ->expectsOutput(' ⇁ This is the description of the command.'); } + public function testDisplayScheduleSubMinute() + { + $this->schedule->command('inspire')->weekly()->everySecond(); + $this->schedule->command('inspire')->everyTwoSeconds(); + $this->schedule->command('inspire')->everyFiveSeconds(); + $this->schedule->command('inspire')->everyTenSeconds(); + $this->schedule->command('inspire')->everyFifteenSeconds(); + $this->schedule->command('inspire')->everyTwentySeconds(); + $this->schedule->command('inspire')->everyThirtySeconds(); + + $this->artisan(ScheduleListCommand::class) + ->assertSuccessful() + ->expectsOutput(' * 0 * * 0 1s php artisan inspire ............. Next Due: 1 second from now') + ->expectsOutput(' * * * * * 2s php artisan inspire ............ Next Due: 2 seconds from now') + ->expectsOutput(' * * * * * 5s php artisan inspire ............ Next Due: 5 seconds from now') + ->expectsOutput(' * * * * * 10s php artisan inspire ........... Next Due: 10 seconds from now') + ->expectsOutput(' * * * * * 15s php artisan inspire ........... Next Due: 15 seconds from now') + ->expectsOutput(' * * * * * 20s php artisan inspire ........... Next Due: 20 seconds from now') + ->expectsOutput(' * * * * * 30s php artisan inspire ........... Next Due: 30 seconds from now'); + } + protected function tearDown(): void { parent::tearDown();