Skip to content

Commit

Permalink
chore: fix integration testing database credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
DeiseCAPBarbosa committed Feb 17, 2025
1 parent b546519 commit 6c841ea
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
48 changes: 24 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ public function client(): ?Client

/**
* Get the user that the token belongs to.
*
* @return Authenticatable|null
*/
public function user(): ?Authenticatable
public function user()
{
$provider = config('auth.guards.api.provider');

Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/AccessTokenControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class AccessTokenControllerTest extends PassportTestCase
{
protected function getUserClass()
protected function getUserClass(): ?string
{
return User::class;
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testGettingAccessTokenWithClientCredentialsGrant()
$this->assertArrayHasKey('expires_in', $decodedResponse);
$this->assertArrayHasKey('access_token', $decodedResponse);
$this->assertSame('Bearer', $decodedResponse['token_type']);
$expiresInSeconds = 31622400;
$expiresInSeconds = 31536000;
$this->assertEqualsWithDelta($expiresInSeconds, $decodedResponse['expires_in'], 5);

$token = $this->app->make(PersonalAccessTokenFactory::class)->findAccessToken($decodedResponse);
Expand Down Expand Up @@ -173,7 +173,7 @@ public function testGettingAccessTokenWithPasswordGrant()
$this->assertArrayHasKey('access_token', $decodedResponse);
$this->assertArrayHasKey('refresh_token', $decodedResponse);
$this->assertSame('Bearer', $decodedResponse['token_type']);
$expiresInSeconds = 31622400;
$expiresInSeconds = 31536000;
$this->assertEqualsWithDelta($expiresInSeconds, $decodedResponse['expires_in'], 5);

$token = $this->app->make(PersonalAccessTokenFactory::class)->findAccessToken($decodedResponse);
Expand Down
8 changes: 3 additions & 5 deletions tests/Feature/PassportTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function tearDown(): void
parent::tearDown();
}

protected function getEnvironmentSetUp($app)
protected function getEnvironmentSetUp($app): void
{
$config = $app->make(Repository::class);

Expand All @@ -64,7 +64,7 @@ protected function getEnvironmentSetUp($app)
]);
}

protected function getPackageProviders($app)
protected function getPackageProviders($app): array
{
return [
PassportServiceProvider::class,
Expand All @@ -74,10 +74,8 @@ protected function getPackageProviders($app)

/**
* Get the Mongolid user model class name.
*
* @return string|null
*/
protected function getUserClass()
protected function getUserClass(): ?string
{
return \Laravel\Passport\Tests\Stubs\User::class;
}
Expand Down

0 comments on commit 6c841ea

Please sign in to comment.