1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Sorting: Added tests to cover AssignSortSetCommand

This commit is contained in:
Dan Brown
2025-02-09 23:24:36 +00:00
parent 37d020c083
commit 69683d50ec
4 changed files with 147 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class AssignSortSetCommand extends Command
}
$query = Book::query()->where('sort_set_id', $sortId);
} else {
$this->error("Either the --all-books or --books-without-sort option must be provided!");
$this->error("No option provided to specify target. Run with the -h option to see all available options.");
return 1;
}
@ -79,7 +79,7 @@ class AssignSortSetCommand extends Command
$processed = $max;
});
$this->info("Sort applied to {$processed} books!");
$this->info("Sort applied to {$processed} book(s)!");
return 0;
}

View File

@ -6,6 +6,7 @@ use BookStack\Activity\Models\Loggable;
use BookStack\Entities\Models\Book;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
@ -18,6 +19,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class SortSet extends Model implements Loggable
{
use HasFactory;
/**
* @return SortSetOperation[]
*/