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:
30
database/factories/Sorting/SortSetFactory.php
Normal file
30
database/factories/Sorting/SortSetFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user