File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Tests/Security/Authentification/Token Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace FOS \OAuthServerBundle \Tests \Security \Authentification \Token ;
4
+
5
+ use FOS \OAuthServerBundle \Model \TokenInterface ;
6
+ use FOS \OAuthServerBundle \Security \Authentication \Token \OAuthToken ;
7
+
8
+ class OAuthTokenTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var OAuthToken
12
+ */
13
+ protected $ instance ;
14
+
15
+ public function setUp ()
16
+ {
17
+ $ this ->instance = new OAuthToken ();
18
+
19
+ parent ::setUp (); // TODO: Change the autogenerated stub
20
+ }
21
+
22
+ public function testSetTokenWillSetToken ()
23
+ {
24
+ $ token = $ this ->createMock (TokenInterface::class);
25
+
26
+ $ this ->assertNull ($ this ->instance ->setToken ($ token ));
27
+ $ this ->assertAttributeSame ($ token , 'token ' , $ this ->instance );
28
+ }
29
+
30
+ public function testGetTokenWillReturnToken ()
31
+ {
32
+ $ token = $ this ->createMock (TokenInterface::class);
33
+
34
+ $ this ->assertNull ($ this ->instance ->getToken ());
35
+ $ this ->assertNull ($ this ->instance ->setToken ($ token ));
36
+ $ this ->assertSame ($ token , $ this ->instance ->getToken ());
37
+ }
38
+
39
+ public function testGetCredentialsWillReturnToken ()
40
+ {
41
+ $ token = $ this ->createMock (TokenInterface::class);
42
+
43
+ $ this ->assertNull ($ this ->instance ->getCredentials ());
44
+ $ this ->assertNull ($ this ->instance ->setToken ($ token ));
45
+ $ this ->assertSame ($ token , $ this ->instance ->getCredentials ());
46
+ }
47
+ }
You can’t perform that action at this time.
0 commit comments