999145d22cd6d5b109948a29a8bd2638d611e658
[WP-Plugins/glm-member-db.git] /
1 <?php 
2 use PayPal\Auth\Openid\PPOpenIdTokeninfo;
3 /**
4  * Test class for PPOpenIdTokeninfo.
5  *
6  */
7 class PPOpenIdTokeninfoTest extends \PHPUnit_Framework_TestCase {
8         
9         public $token;
10
11         /**
12          * Sets up the fixture, for example, opens a network connection.
13          * This method is called before a test is executed.
14          */
15         protected function setUp() {
16                 $this->token = new PPOpenIdTokeninfo();
17                 $this->token->setAccessToken("Access token")
18                                         ->setExpiresIn(900)
19                                         ->setRefreshToken("Refresh token")
20                                         ->setScope("openid address")
21                                         ->setTokenType("Bearer");
22         }
23         
24         /**
25          * Tears down the fixture, for example, closes a network connection.
26          * This method is called after a test is executed.
27          */
28         protected function tearDown()
29         {
30         }
31         
32         /**
33          * @test
34          */
35         public function testSerializationDeserialization() {                            
36                 $tokenCopy = new PPOpenIdTokeninfo();
37                 $tokenCopy->fromJson($this->token->toJson());
38                 
39                 $this->assertEquals($this->token, $tokenCopy);
40         }
41 }