diff --git a/src/Commands/PauseHealthChecksCommand.php b/src/Commands/PauseHealthChecksCommand.php index 9eb929cf..9ce9359e 100644 --- a/src/Commands/PauseHealthChecksCommand.php +++ b/src/Commands/PauseHealthChecksCommand.php @@ -8,9 +8,11 @@ class PauseHealthChecksCommand extends Command { public const CACHE_KEY = 'health_paused'; + public const DEFAULT_TTL = 300; - protected $signature = 'health:pause {seconds=' . self::DEFAULT_TTL . '}'; + protected $signature = 'health:pause {seconds='.self::DEFAULT_TTL.'}'; + protected $description = 'Pause all health checks for the giving time'; public function handle(): int @@ -19,7 +21,7 @@ public function handle(): int Cache::put(self::CACHE_KEY, true, $seconds); - $this->comment('All health check paused until ' . now()->addSeconds($seconds)->toDateTimeString()); + $this->comment('All health check paused until '.now()->addSeconds($seconds)->toDateTimeString()); return self::SUCCESS; } diff --git a/src/Commands/ResumeHealthChecksCommand.php b/src/Commands/ResumeHealthChecksCommand.php index 4b7c5408..e55f9e04 100644 --- a/src/Commands/ResumeHealthChecksCommand.php +++ b/src/Commands/ResumeHealthChecksCommand.php @@ -8,6 +8,7 @@ class ResumeHealthChecksCommand extends Command { protected $signature = 'health:resume'; + protected $description = 'Resume all health checks'; public function handle(): int diff --git a/tests/Commands/ResumeChecksCommandTest.php b/tests/Commands/ResumeChecksCommandTest.php index 5bf42ba1..bbef132e 100644 --- a/tests/Commands/ResumeChecksCommandTest.php +++ b/tests/Commands/ResumeChecksCommandTest.php @@ -3,8 +3,8 @@ use Illuminate\Contracts\Cache\Repository; use Illuminate\Support\Facades\Cache; use Spatie\Health\Commands\PauseHealthChecksCommand; - use Spatie\Health\Commands\ResumeHealthChecksCommand; + use function Pest\Laravel\artisan; it('forgets cache value', function () { @@ -21,6 +21,5 @@ artisan(ResumeHealthChecksCommand::class) ->assertSuccessful() - ->expectsOutput('All health check resumed') - ; + ->expectsOutput('All health check resumed'); });