mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Fix test coverage for creating account API keys
This commit is contained in:
28
database/Factories/PersonalAccessTokenFactory.php
Normal file
28
database/Factories/PersonalAccessTokenFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Pterodactyl\Models\PersonalAccessToken;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class PersonalAccessTokenFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $model = PersonalAccessToken::class;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'token_id' => PersonalAccessToken::generateTokenIdentifier(),
|
||||
'token' => hash('sha256', Str::random(PersonalAccessToken::TOKEN_LENGTH)),
|
||||
'description' => 'Generated test token',
|
||||
'abilities' => ['*'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user