File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
Expand file tree Collapse file tree 3 files changed +14
-8
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 99 )->toBeString ();
1010});
1111
12- it ('can generate webhook verification key ' , function () {
12+ it ('can request webhook verification key ' , function () {
1313 expect (VivaWallet::requestWebhookKey ())->toBeString ();
1414});
Original file line number Diff line number Diff line change 11<?php
22
3- use Deyjandi \VivaWallet \Helpers \ClientAuth ;
43use Deyjandi \VivaWallet \VivaWalletToken ;
54use Illuminate \Support \Carbon ;
65
7- it (
8- 'can make auth header ' ,
9- fn () => expect (ClientAuth::token (VivaWalletToken::getInstance ()))->toBeString ()
10- );
6+ it ('can issue auth token ' , function () {
7+ $ token = VivaWalletToken::getInstance ();
8+
9+ expect ($ token ->getAccessToken ())->toBeString ();
10+ });
1111
12- it ('can hit and expire from cache ' , function () {
12+ it ('can hit cache ' , function () {
1313 $ token = VivaWalletToken::getInstance ();
1414
1515 expect (cache ('viva_wallet_token ' ))->toEqual ($ token );
16+ });
17+
18+ it ('can expire ' , function () {
19+ $ token = VivaWalletToken::getInstance ();
1620
1721 Carbon::setTestNow (now ()->addSeconds ($ token ->getExpiresIn ()));
1822
23+ expect ($ token ->isExpired ())->toBeTrue ();
24+
1925 expect (cache ('viva_wallet_token ' ))->toBeNull ();
2026});
You can’t perform that action at this time.
0 commit comments