mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 12:42:15 +01:00
Renamed command admin:delete-organization to admin:organization:delete
This commit is contained in:
committed by
Constantin Graf
parent
498f29617e
commit
50902e7705
@@ -9,14 +9,14 @@ use App\Service\DeletionService;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class DeleteOrganizationCommand extends Command
|
class OrganizationDeleteCommand extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* The name and signature of the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'admin:delete-organization
|
protected $signature = 'admin:organization:delete
|
||||||
{ organization : The ID of the organization to delete }';
|
{ organization : The ID of the organization to delete }';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +24,7 @@ class DeleteOrganizationCommand extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Delete a organization.';
|
protected $description = 'Delete a organization';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Unit\Console\Commands\Admin;
|
namespace Tests\Unit\Console\Commands\Admin;
|
||||||
|
|
||||||
use App\Console\Commands\Admin\DeleteOrganizationCommand;
|
use App\Console\Commands\Admin\OrganizationDeleteCommand;
|
||||||
use App\Models\Organization;
|
use App\Models\Organization;
|
||||||
use App\Service\DeletionService;
|
use App\Service\DeletionService;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@@ -13,9 +13,9 @@ use PHPUnit\Framework\Attributes\CoversClass;
|
|||||||
use PHPUnit\Framework\Attributes\UsesClass;
|
use PHPUnit\Framework\Attributes\UsesClass;
|
||||||
use Tests\TestCaseWithDatabase;
|
use Tests\TestCaseWithDatabase;
|
||||||
|
|
||||||
#[CoversClass(DeleteOrganizationCommand::class)]
|
#[CoversClass(OrganizationDeleteCommand::class)]
|
||||||
#[UsesClass(DeleteOrganizationCommand::class)]
|
#[UsesClass(OrganizationDeleteCommand::class)]
|
||||||
class DeleteOrganizationCommandTest extends TestCaseWithDatabase
|
class OrganizationDeleteCommandTest extends TestCaseWithDatabase
|
||||||
{
|
{
|
||||||
public function test_it_calls_the_deletion_service_with_the_organization(): void
|
public function test_it_calls_the_deletion_service_with_the_organization(): void
|
||||||
{
|
{
|
||||||
@@ -28,7 +28,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// 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("Deleting organization with ID {$organization->getKey()}")
|
||||||
->expectsOutput("Organization with ID {$organization->getKey()} has been deleted.")
|
->expectsOutput("Organization with ID {$organization->getKey()} has been deleted.")
|
||||||
->assertExitCode(0);
|
->assertExitCode(0);
|
||||||
@@ -40,7 +40,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase
|
|||||||
$organizationId = Str::uuid()->toString();
|
$organizationId = Str::uuid()->toString();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
$this->artisan('admin:delete-organization', ['organization' => $organizationId])
|
$this->artisan('admin:organization:delete', ['organization' => $organizationId])
|
||||||
->expectsOutput('Organization with ID '.$organizationId.' not found.')
|
->expectsOutput('Organization with ID '.$organizationId.' not found.')
|
||||||
->assertExitCode(1);
|
->assertExitCode(1);
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ class DeleteOrganizationCommandTest extends TestCaseWithDatabase
|
|||||||
$organizationId = 'invalid-uuid';
|
$organizationId = 'invalid-uuid';
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
$this->artisan('admin:delete-organization', ['organization' => $organizationId])
|
$this->artisan('admin:organization:delete', ['organization' => $organizationId])
|
||||||
->expectsOutput('Organization ID must be a valid UUID.')
|
->expectsOutput('Organization ID must be a valid UUID.')
|
||||||
->assertExitCode(1);
|
->assertExitCode(1);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user