Fix test coverage for creating account API keys

This commit is contained in:
Dane Everitt 2021-08-07 15:20:43 -07:00
parent 3d14974d64
commit 815ce0e451
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 62 additions and 148 deletions

View file

@ -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.
*