From 8cfd5fbe0f9c7d661a37a46051cc8d8d1daa1173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Thu, 20 Aug 2026 17:35:31 +0200 Subject: [PATCH] refactor(console): scope client artisan commands under arcadia prefix --- .../Console/Commands/CreateClientCommand.php | 2 +- .../Console/Commands/ListClientsCommand.php | 2 +- .../Commands/RegenerateClientSecretCommand.php | 2 +- .../Commands/ToggleClientStatusCommand.php | 2 +- .../Console/Commands/CreateClientCommandTest.php | 8 ++++---- .../Console/Commands/ListClientsCommandTest.php | 6 +++--- .../RegenerateClientSecretCommandTest.php | 10 +++++----- .../Commands/ToggleClientStatusCommandTest.php | 16 ++++++++-------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Presentation/Console/Commands/CreateClientCommand.php b/src/Presentation/Console/Commands/CreateClientCommand.php index 0822402..d31b0f8 100644 --- a/src/Presentation/Console/Commands/CreateClientCommand.php +++ b/src/Presentation/Console/Commands/CreateClientCommand.php @@ -23,7 +23,7 @@ final class CreateClientCommand extends Command /** * @var string */ - protected $signature = 'client:create'; + protected $signature = 'arcadia:client:create'; /** * @var string diff --git a/src/Presentation/Console/Commands/ListClientsCommand.php b/src/Presentation/Console/Commands/ListClientsCommand.php index 46ec2d3..6e40b48 100644 --- a/src/Presentation/Console/Commands/ListClientsCommand.php +++ b/src/Presentation/Console/Commands/ListClientsCommand.php @@ -19,7 +19,7 @@ final class ListClientsCommand extends Command /** * @var string */ - protected $signature = 'client:list + protected $signature = 'arcadia:client:list {--page=1 : The page number} {--per-page=25 : The number of clients per page}'; diff --git a/src/Presentation/Console/Commands/RegenerateClientSecretCommand.php b/src/Presentation/Console/Commands/RegenerateClientSecretCommand.php index 410db0e..663357c 100644 --- a/src/Presentation/Console/Commands/RegenerateClientSecretCommand.php +++ b/src/Presentation/Console/Commands/RegenerateClientSecretCommand.php @@ -27,7 +27,7 @@ final class RegenerateClientSecretCommand extends Command implements PromptsForM /** * @var string */ - protected $signature = 'client:regenerate-secret + protected $signature = 'arcadia:client:regenerate-secret {identifier : The identifier of the client}'; /** diff --git a/src/Presentation/Console/Commands/ToggleClientStatusCommand.php b/src/Presentation/Console/Commands/ToggleClientStatusCommand.php index 16b7782..3f50202 100644 --- a/src/Presentation/Console/Commands/ToggleClientStatusCommand.php +++ b/src/Presentation/Console/Commands/ToggleClientStatusCommand.php @@ -26,7 +26,7 @@ final class ToggleClientStatusCommand extends Command implements PromptsForMissi /** * @var string */ - protected $signature = 'client:toggle-status + protected $signature = 'arcadia:client:toggle-status {identifier : The identifier of the client} {status? : The desired status of the client (activate|deactivate)}'; diff --git a/tests/Feature/Console/Commands/CreateClientCommandTest.php b/tests/Feature/Console/Commands/CreateClientCommandTest.php index 28d2ef0..92cde00 100644 --- a/tests/Feature/Console/Commands/CreateClientCommandTest.php +++ b/tests/Feature/Console/Commands/CreateClientCommandTest.php @@ -16,7 +16,7 @@ describe('CreateClientCommand', function (): void { $clientName = 'Production Gateway'; // WHEN - $this->artisan('client:create') + $this->artisan('arcadia:client:create') // THEN ->expectsQuestion('Client name (e.g. "Ones Branding website")', $clientName) ->expectsConfirmation('Create this API client?', 'yes') @@ -38,7 +38,7 @@ describe('CreateClientCommand', function (): void { $clientName = 'Cancelled Gateway'; // WHEN - $this->artisan('client:create') + $this->artisan('arcadia:client:create') // THEN ->expectsQuestion('Client name (e.g. "Ones Branding website")', $clientName) ->expectsConfirmation('Create this API client?', 'no') @@ -51,7 +51,7 @@ describe('CreateClientCommand', function (): void { it('fails when an empty name is provided', function (): void { // GIVEN & WHEN & THEN - $this->artisan('client:create') + $this->artisan('arcadia:client:create') ->expectsQuestion('Client name (e.g. "Ones Branding website")', '') ->assertFailed(); }); @@ -65,7 +65,7 @@ describe('CreateClientCommand', function (): void { ]); // WHEN & THEN - $this->artisan('client:create') + $this->artisan('arcadia:client:create') ->expectsQuestion('Client name (e.g. "Ones Branding website")', 'Existing Gateway') ->assertFailed(); }); diff --git a/tests/Feature/Console/Commands/ListClientsCommandTest.php b/tests/Feature/Console/Commands/ListClientsCommandTest.php index 1b142a3..b8deee6 100644 --- a/tests/Feature/Console/Commands/ListClientsCommandTest.php +++ b/tests/Feature/Console/Commands/ListClientsCommandTest.php @@ -17,7 +17,7 @@ describe('ListClientsCommand', function (): void { ApiClient::query()->delete(); // WHEN - $this->artisan('client:list') + $this->artisan('arcadia:client:list') // THEN ->expectsOutput('No clients found.') ->assertSuccessful(); @@ -47,7 +47,7 @@ describe('ListClientsCommand', function (): void { ]); // WHEN - $this->artisan('client:list') + $this->artisan('arcadia:client:list') // THEN ->expectsTable( ['ID', 'Name', 'Identifier', 'Status', 'Last Updated At'], @@ -89,7 +89,7 @@ describe('ListClientsCommand', function (): void { } // WHEN - $this->artisan('client:list', ['--page' => '2', '--per-page' => '2']) + $this->artisan('arcadia:client:list', ['--page' => '2', '--per-page' => '2']) // THEN ->expectsOutput('Showing page 2/2 (Total: 3 client(s))') ->assertSuccessful(); diff --git a/tests/Feature/Console/Commands/RegenerateClientSecretCommandTest.php b/tests/Feature/Console/Commands/RegenerateClientSecretCommandTest.php index 63672a6..a94e394 100644 --- a/tests/Feature/Console/Commands/RegenerateClientSecretCommandTest.php +++ b/tests/Feature/Console/Commands/RegenerateClientSecretCommandTest.php @@ -18,7 +18,7 @@ describe('RegenerateClientSecretCommand', function (): void { $invalidIdentifier = 'invalid-id'; // WHEN - $this->artisan('client:regenerate-secret', ['identifier' => $invalidIdentifier]) + $this->artisan('arcadia:client:regenerate-secret', ['identifier' => $invalidIdentifier]) // THEN ->expectsOutput("Invalid client identifier '{$invalidIdentifier}'. Expected a valid client identifier.") ->assertFailed(); @@ -30,7 +30,7 @@ describe('RegenerateClientSecretCommand', function (): void { $nonExistentIdentifier = 'arcadia_id_' . str_repeat('f', 32); // WHEN - $this->artisan('client:regenerate-secret', ['identifier' => $nonExistentIdentifier]) + $this->artisan('arcadia:client:regenerate-secret', ['identifier' => $nonExistentIdentifier]) // THEN ->expectsOutput("Client '{$nonExistentIdentifier}' not found.") ->assertFailed(); @@ -52,7 +52,7 @@ describe('RegenerateClientSecretCommand', function (): void { ]); // WHEN - $this->artisan('client:regenerate-secret', ['identifier' => $identifier]) + $this->artisan('arcadia:client:regenerate-secret', ['identifier' => $identifier]) // THEN ->expectsConfirmation('Do you want to proceed?', 'yes') ->expectsOutputToContain("Secret for client '{$identifier}' regenerated successfully.") @@ -80,7 +80,7 @@ describe('RegenerateClientSecretCommand', function (): void { ]); // WHEN - $this->artisan('client:regenerate-secret', ['identifier' => $identifier]) + $this->artisan('arcadia:client:regenerate-secret', ['identifier' => $identifier]) // THEN ->expectsConfirmation('Do you want to proceed?', 'no') ->expectsOutput('Secret regeneration cancelled.') @@ -106,7 +106,7 @@ describe('RegenerateClientSecretCommand', function (): void { ]); // WHEN - $this->artisan('client:regenerate-secret') + $this->artisan('arcadia:client:regenerate-secret') // THEN ->expectsQuestion('Search client (by name, ID, identifier, or slug):', $identifier) ->expectsChoice('Search client (by name, ID, identifier, or slug):', $identifier, [ diff --git a/tests/Feature/Console/Commands/ToggleClientStatusCommandTest.php b/tests/Feature/Console/Commands/ToggleClientStatusCommandTest.php index 6e1647e..e325b67 100644 --- a/tests/Feature/Console/Commands/ToggleClientStatusCommandTest.php +++ b/tests/Feature/Console/Commands/ToggleClientStatusCommandTest.php @@ -18,7 +18,7 @@ describe('ToggleClientStatusCommand', function (): void { $invalidId = 'not-a-valid-identifier'; // WHEN - $this->artisan('client:toggle-status', ['identifier' => $invalidId]) + $this->artisan('arcadia:client:toggle-status', ['identifier' => $invalidId]) // THEN ->expectsOutput("Invalid client identifier '{$invalidId}'. Expected a valid client identifier.") ->assertFailed(); @@ -30,7 +30,7 @@ describe('ToggleClientStatusCommand', function (): void { $nonExistentId = 'arcadia_id_' . str_repeat('9', 32); // WHEN - $this->artisan('client:toggle-status', ['identifier' => $nonExistentId]) + $this->artisan('arcadia:client:toggle-status', ['identifier' => $nonExistentId]) // THEN ->expectsOutput("Client '{$nonExistentId}' not found.") ->assertFailed(); @@ -49,7 +49,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status', ['identifier' => (string) $client->identifier->value]) + $this->artisan('arcadia:client:toggle-status', ['identifier' => (string) $client->identifier->value]) // THEN ->expectsOutput("Client 'Production Gateway' (ID: {$client->id}) is now Inactive.") ->assertSuccessful(); @@ -71,7 +71,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status', ['identifier' => (string) $client->identifier->value]) + $this->artisan('arcadia:client:toggle-status', ['identifier' => (string) $client->identifier->value]) // THEN ->expectsOutput("Client 'Backup Gateway' (ID: {$client->id}) is now Active.") ->assertSuccessful(); @@ -93,7 +93,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status', ['identifier' => (string) $client->identifier->value, 'status' => 'activate']) + $this->artisan('arcadia:client:toggle-status', ['identifier' => (string) $client->identifier->value, 'status' => 'activate']) // THEN ->expectsOutput("Client 'Special Gateway' (ID: {$client->id}) is now Active.") ->assertSuccessful(); @@ -115,7 +115,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status', ['identifier' => (string) $client->identifier->value, 'status' => 'deactivate']) + $this->artisan('arcadia:client:toggle-status', ['identifier' => (string) $client->identifier->value, 'status' => 'deactivate']) // THEN ->expectsOutput("Client 'Special Gateway' (ID: {$client->id}) is now Inactive.") ->assertSuccessful(); @@ -138,7 +138,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status', ['identifier' => $identifier, 'status' => 'unknown']) + $this->artisan('arcadia:client:toggle-status', ['identifier' => $identifier, 'status' => 'unknown']) // THEN ->expectsOutput("Invalid status 'unknown'. Expected 'activate' or 'deactivate'.") ->assertFailed(); @@ -158,7 +158,7 @@ describe('ToggleClientStatusCommand', function (): void { ]); // WHEN - $this->artisan('client:toggle-status') + $this->artisan('arcadia:client:toggle-status') // THEN ->expectsQuestion('Search client (by name, ID, identifier, or slug):', $identifier) ->expectsChoice('Search client (by name, ID, identifier, or slug):', $identifier, [