FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bazaar-api-php/tests/MemoryTokenStorageTest.php at master · nikapps/bazaar-api-php · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nikapps
/
bazaar-api-php
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
bazaar-api-php
/
tests
/
MemoryTokenStorageTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (29 loc) · 946 Bytes
Breadcrumbs
bazaar-api-php
/
tests
/
MemoryTokenStorageTest.php
Copy path
File metadata and controls
36 lines (29 loc) · 946 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace
Nikapps
\
BazaarApi
\
Tests
;
use
Nikapps
\
BazaarApi
\
Models
\
Token
;
use
Nikapps
\
BazaarApi
\
Storage
\
MemoryTokenStorage
;
class
MemoryTokenStorageTest
extends
TestCase
{
/** @test */
public
function
it_should_save_the_token
()
{
$
storage
=
new
MemoryTokenStorage
();
$
token
=
new
Token
([
"
access_token
"
=>
"
123456
"
,
"
token_type
"
=>
"
Bearer
"
,
"
expires_in
"
=>
3600
,
"
scope
"
=>
"
androidpublisher
"
,
'
refresh_token
'
=>
'
refresh-token
'
]);
$
storage
->
save
(
$
token
);
$
this
->
assertFalse
(
$
storage
->
expired
());
$
this
->
assertEquals
(
'
123456
'
,
$
storage
->
retrieve
());
}
/** @test */
public
function
it_should_say_token_has_been_expired_when_token_does_not_exist
()
{
$
storage
=
new
MemoryTokenStorage
();
$
this
->
assertTrue
(
$
storage
->
expired
());
$
this
->
assertNull
(
$
storage
->
retrieve
());
}
}
Back
|
FazBrowse Home
|
New Git URL