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:
@ -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;
|
||||
}
|
||||
|
@ -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[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user