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
|
@ -34,7 +34,7 @@ abstract class ApplicationApiIntegrationTestCase extends IntegrationTestCase
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->user = $this->createApiUser();
|
||||
$this->user = User::factory()->create(['root_admin' => true]);
|
||||
$this->key = $this->createApiKey($this->user);
|
||||
|
||||
$this->withHeader('Accept', 'application/vnd.pterodactyl.v1+json');
|
||||
|
@ -85,18 +85,6 @@ abstract class ApplicationApiIntegrationTestCase extends IntegrationTestCase
|
|||
$this->withHeader('Authorization', 'Bearer ' . $key->identifier . decrypt($key->token));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an administrative user.
|
||||
*
|
||||
* @return \Pterodactyl\Models\User
|
||||
*/
|
||||
protected function createApiUser(): User
|
||||
{
|
||||
return User::factory()->create([
|
||||
'root_admin' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new application API key for a given user model.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue