refactor(console): scope client artisan commands under arcadia prefix
This commit is contained in:
parent
6f35e031fa
commit
8cfd5fbe0f
8 changed files with 24 additions and 24 deletions
|
|
@ -23,7 +23,7 @@ final class CreateClientCommand extends Command
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'client:create';
|
||||
protected $signature = 'arcadia:client:create';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
|
|
|||
|
|
@ -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}';
|
||||
|
||||
|
|
|
|||
|
|
@ -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}';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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)}';
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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, [
|
||||
|
|
|
|||
|
|
@ -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, [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue