Renamed command admin:delete-organization to admin:organization:delete

This commit is contained in:
Constantin Graf
2024-09-13 17:39:21 +02:00
committed by Constantin Graf
parent 498f29617e
commit 50902e7705
2 changed files with 10 additions and 10 deletions

View File

@@ -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.

View File

@@ -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);
}