Fix test coverage for creating account API keys
This commit is contained in:
parent
3d14974d64
commit
815ce0e451
6 changed files with 62 additions and 148 deletions
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' => ['*'],
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue