File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public function getScope(): string
8383 return $ this ->scope ;
8484 }
8585
86- private function isExpired (): bool
86+ public function isExpired (): bool
8787 {
8888 return now ()->gte ($ this ->issuedAt ->addSeconds ($ this ->getExpiresIn ()));
8989 }
Original file line number Diff line number Diff line change 44use Illuminate \Support \Carbon ;
55
66it ('can issue auth token ' , function () {
7- expect (VivaWalletToken::getInstance ())->toBeString ();
7+ $ token = VivaWalletToken::getInstance ();
8+
9+ expect ($ token ->getAccessToken ())->toBeString ();
810});
911
1012it ('can hit cache ' , function () {
1315 expect (cache ('viva_wallet_token ' ))->toEqual ($ token );
1416});
1517
16- it ('can expire from cache ' , function () {
18+ it ('can expire ' , function () {
1719 $ token = VivaWalletToken::getInstance ();
1820
1921 Carbon::setTestNow (now ()->addSeconds ($ token ->getExpiresIn ()));
2022
23+ expect ($ token ->isExpired ())->toBeTrue ();
24+
2125 expect (cache ('viva_wallet_token ' ))->toBeNull ();
2226});
You can’t perform that action at this time.
0 commit comments