mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-05 01:24:38 +08:00
Webhooks: Fixed failing delete-based events
Due to queue serialization. Added a test to check a couple of delete events. Added ApiTokenFactory to support. Also made a couple of typing/doc updates while there. Related to #4373
This commit is contained in:
27
database/factories/Api/ApiTokenFactory.php
Normal file
27
database/factories/Api/ApiTokenFactory.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories\Api;
|
||||
|
||||
use BookStack\Api\ApiToken;
|
||||
use BookStack\Users\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ApiTokenFactory extends Factory
|
||||
{
|
||||
protected $model = ApiToken::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'token_id' => Str::random(10),
|
||||
'secret' => Str::random(12),
|
||||
'name' => $this->faker->name(),
|
||||
'expires_at' => Carbon::now()->addYear(),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
'user_id' => User::factory(),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user