diff --git a/composer.json b/composer.json index f7abbc5..33dbac5 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,10 @@ "require": { "php": "^8.0.2", "ext-json": "*", - "illuminate/console": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/database": "^9.0", - "illuminate/support": "^9.0" + "illuminate/console": "^9.21", + "illuminate/contracts": "^9.21", + "illuminate/database": "^9.21", + "illuminate/support": "^9.21" }, "require-dev": { "mockery/mockery": "^1.0", diff --git a/src/Console/Commands/PruneExpired.php b/src/Console/Commands/PruneExpired.php index 0e07bfb..b6ede50 100644 --- a/src/Console/Commands/PruneExpired.php +++ b/src/Console/Commands/PruneExpired.php @@ -35,12 +35,12 @@ public function handle() $model::where('created_at', '<', now()->subMinutes($expiration + ($hours * 60)))->delete(); - $this->info("Tokens expired for more than {$hours} hours pruned successfully."); + $this->components->info("Tokens expired for more than [$hours hours] pruned successfully."); return 0; } - $this->warn('Expiration value not specified in configuration file.'); + $this->components->warn('Expiration value not specified in configuration file.'); return 1; } diff --git a/tests/PruneExpiredTest.php b/tests/PruneExpiredTest.php index b28b08a..e0e09e3 100644 --- a/tests/PruneExpiredTest.php +++ b/tests/PruneExpiredTest.php @@ -60,7 +60,7 @@ public function test_can_delete_expired_tokens_with_integer_expiration() ]); $this->artisan('sanctum:prune-expired --hours=2') - ->expectsOutput('Tokens expired for more than 2 hours pruned successfully.'); + ->expectsOutputToContain('Tokens expired for more than [2 hours] pruned successfully.'); $this->assertDatabaseMissing('personal_access_tokens', ['name' => 'Test_1']); $this->assertDatabaseHas('personal_access_tokens', ['name' => 'Test_2']); @@ -89,7 +89,7 @@ public function test_cant_delete_expired_tokens_with_null_expiration() ]); $this->artisan('sanctum:prune-expired --hours=2') - ->expectsOutput('Expiration value not specified in configuration file.'); + ->expectsOutputToContain('Expiration value not specified in configuration file.'); $this->assertDatabaseHas('personal_access_tokens', ['name' => 'Test']); }