1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-13 11:47:56 +03:00

Covered untested commands with testing

This commit is contained in:
Dan Brown
2023-05-24 10:34:43 +01:00
parent 3b31ac75ec
commit 0704f1bd0d
6 changed files with 141 additions and 2 deletions

View File

@@ -49,7 +49,8 @@ class CleanupImages extends Command
$dryRun = $this->option('force') ? false : true;
if (!$dryRun) {
$proceed = $this->confirm("This operation is destructive and is not guaranteed to be fully accurate.\nEnsure you have a backup of your images.\nAre you sure you want to proceed?");
$this->warn("This operation is destructive and is not guaranteed to be fully accurate.\nEnsure you have a backup of your images.\n");
$proceed = $this->confirm("Are you sure you want to proceed?");
if (!$proceed) {
return;
}
@@ -59,7 +60,7 @@ class CleanupImages extends Command
$deleteCount = count($deleted);
if ($dryRun) {
$this->comment('Dry run, No images have been deleted');
$this->comment('Dry run, no images have been deleted');
$this->comment($deleteCount . ' images found that would have been deleted');
$this->showDeletedImages($deleted);
$this->comment('Run with -f or --force to perform deletions');