1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +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

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories\Sorting;
use BookStack\Sorting\SortSet;
use BookStack\Sorting\SortSetOperation;
use Illuminate\Database\Eloquent\Factories\Factory;
class SortSetFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = SortSet::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
$cases = SortSetOperation::cases();
$op = $cases[array_rand($cases)];
return [
'name' => $op->name . ' Sort',
'sequence' => $op->value,
];
}
}