Skip to content

Commit

Permalink
Add test for hasExpired when using setTimeNow.
Browse files Browse the repository at this point in the history
  • Loading branch information
prikkprikkprikk committed Feb 25, 2023
1 parent cc2543c commit cc35fb1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/src/Token/AccessTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ public function testHasExpiredWhenPropertySetInPast()
self::tearDownForBackwardsCompatibility();
}

public function testHasExpiredWhenTimeNowIsInFuture()
{
$options = [
'access_token' => 'mock_access_token',
'expires' => time(),
];

$token = $this->getAccessToken($options);

$token->setTimeNow(time() + 60);

$this->assertTrue($token->hasExpired());

self::tearDownForBackwardsCompatibility();
}

public function testCannotReportExpiredWhenNoExpirationSet()
{
$options = [
Expand Down

0 comments on commit cc35fb1

Please sign in to comment.