mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Add unit tests for user management commands
This commit is contained in:
@@ -79,14 +79,14 @@ class DeleteUserCommand extends Command
|
||||
$results = $this->repository->search($search)->all();
|
||||
if (count($results) < 1) {
|
||||
$this->error(trans('command/messages.user.no_users_found'));
|
||||
if (! $this->option('no-interaction')) {
|
||||
if ($this->input->isInteractive()) {
|
||||
return $this->handle();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $this->option('no-interaction')) {
|
||||
if ($this->input->isInteractive()) {
|
||||
$tableValues = [];
|
||||
foreach ($results as $user) {
|
||||
$tableValues[] = [$user->id, $user->email, $user->name];
|
||||
@@ -106,7 +106,7 @@ class DeleteUserCommand extends Command
|
||||
$deleteUser = $results->first();
|
||||
}
|
||||
|
||||
if ($this->confirm(trans('command/messages.user.confirm_delete')) || $this->option('no-interaction')) {
|
||||
if ($this->confirm(trans('command/messages.user.confirm_delete')) || ! $this->input->isInteractive()) {
|
||||
$this->deletionService->handle($deleteUser);
|
||||
$this->info(trans('command/messages.user.deleted'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user