Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Customize RefreshToken #966

Merged
merged 7 commits into from
Feb 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test refresh token model configuration
  • Loading branch information
donovanhare authored and driesvints committed Feb 22, 2019
commit 0381d6d96f73e0cbd08154ac75552ab73f16bfd8
24 changes: 24 additions & 0 deletions tests/PassportTest.php
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
use Laravel\Passport\AuthCode;
use Laravel\Passport\Passport;
use PHPUnit\Framework\TestCase;
use Laravel\Passport\RefreshToken;
use Laravel\Passport\ClientRepository;
use Laravel\Passport\PersonalAccessClient;

@@ -65,6 +66,24 @@ public function test_token_instance_can_be_created()
$this->assertInstanceOf(Token::class, $token);
$this->assertInstanceOf(Passport::tokenModel(), $token);
}

public function test_refresh_token_instance_can_be_created()
{
$refreshToken = Passport::refreshToken();

$this->assertInstanceOf(RefreshToken::class, $refreshToken);
$this->assertInstanceOf(Passport::refreshTokenModel(), $refreshToken);
}

public function test_refresh_token_model_can_be_changed()
{
Passport::useRefreshTokenModel(RefreshTokenStub::class);

$refreshToken = Passport::refreshToken();

$this->assertInstanceOf(RefreshTokenStub::class, $refreshToken);
$this->assertInstanceOf(Passport::refreshTokenModel(), $refreshToken);
}
}

class PersonalAccessClientStub
@@ -74,3 +93,8 @@ public function exists()
return false;
}
}

class RefreshTokenStub
{

}