diff --git a/app/Console/Commands/Admin/DeleteOrganizationCommand.php b/app/Console/Commands/Admin/OrganizationDeleteCommand.php similarity index 89% rename from app/Console/Commands/Admin/DeleteOrganizationCommand.php rename to app/Console/Commands/Admin/OrganizationDeleteCommand.php index e32b90d0..d6a0b5ea 100644 --- a/app/Console/Commands/Admin/DeleteOrganizationCommand.php +++ b/app/Console/Commands/Admin/OrganizationDeleteCommand.php @@ -9,14 +9,14 @@ use App\Service\DeletionService; use Illuminate\Console\Command; use Illuminate\Support\Str; -class DeleteOrganizationCommand extends Command +class OrganizationDeleteCommand extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'admin:delete-organization + protected $signature = 'admin:organization:delete { organization : The ID of the organization to delete }'; /** @@ -24,7 +24,7 @@ class DeleteOrganizationCommand extends Command * * @var string */ - protected $description = 'Delete a organization.'; + protected $description = 'Delete a organization'; /** * Execute the console command. diff --git a/tests/Unit/Console/Commands/Admin/DeleteOrganizationCommandTest.php b/tests/Unit/Console/Commands/Admin/OrganizationDeleteCommandTest.php similarity index 80% rename from tests/Unit/Console/Commands/Admin/DeleteOrganizationCommandTest.php rename to tests/Unit/Console/Commands/Admin/OrganizationDeleteCommandTest.php index c3959c51..5c4201f8 100644 --- a/tests/Unit/Console/Commands/Admin/DeleteOrganizationCommandTest.php +++ b/tests/Unit/Console/Commands/Admin/OrganizationDeleteCommandTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Tests\Unit\Console\Commands\Admin; -use App\Console\Commands\Admin\DeleteOrganizationCommand; +use App\Console\Commands\Admin\OrganizationDeleteCommand; use App\Models\Organization; use App\Service\DeletionService; use Illuminate\Support\Str; @@ -13,9 +13,9 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\UsesClass; use Tests\TestCaseWithDatabase; -#[CoversClass(DeleteOrganizationCommand::class)] -#[UsesClass(DeleteOrganizationCommand::class)] -class DeleteOrganizationCommandTest extends TestCaseWithDatabase +#[CoversClass(OrganizationDeleteCommand::class)] +#[UsesClass(OrganizationDeleteCommand::class)] +class OrganizationDeleteCommandTest extends TestCaseWithDatabase { public function test_it_calls_the_deletion_service_with_the_organization(): void { @@ -28,7 +28,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase }); // Act - $this->artisan('admin:delete-organization', ['organization' => $organization->getKey()]) + $this->artisan('admin:organization:delete', ['organization' => $organization->getKey()]) ->expectsOutput("Deleting organization with ID {$organization->getKey()}") ->expectsOutput("Organization with ID {$organization->getKey()} has been deleted.") ->assertExitCode(0); @@ -40,7 +40,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase $organizationId = Str::uuid()->toString(); // Act - $this->artisan('admin:delete-organization', ['organization' => $organizationId]) + $this->artisan('admin:organization:delete', ['organization' => $organizationId]) ->expectsOutput('Organization with ID '.$organizationId.' not found.') ->assertExitCode(1); } @@ -51,7 +51,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase $organizationId = 'invalid-uuid'; // Act - $this->artisan('admin:delete-organization', ['organization' => $organizationId]) + $this->artisan('admin:organization:delete', ['organization' => $organizationId]) ->expectsOutput('Organization ID must be a valid UUID.') ->assertExitCode(1); }