1 | <?php |
||
7 | class ApiDetailsTest extends PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | public function testConstructor() |
||
10 | { |
||
11 | $refreshToken = 'refreshToken'; |
||
12 | $clientId = 'clientId'; |
||
13 | $secret = 'secret'; |
||
14 | $redirectUri = 'redirectUri'; |
||
15 | $devToken = 'devToken'; |
||
16 | |||
17 | $apiDetails = new ApiDetails($refreshToken, $clientId, $secret, $redirectUri, $devToken); |
||
18 | |||
19 | $this->assertEquals($refreshToken, $apiDetails->getRefreshToken()); |
||
20 | $this->assertEquals($clientId, $apiDetails->getClientId()); |
||
21 | $this->assertEquals($secret, $apiDetails->getSecret()); |
||
22 | $this->assertEquals($redirectUri, $apiDetails->getRedirectUri()); |
||
23 | $this->assertEquals($devToken, $apiDetails->getDevToken()); |
||
24 | } |
||
25 | |||
26 | public function testSetRefreshToken() |
||
27 | { |
||
28 | $refreshToken = 'refreshToken'; |
||
29 | $apiDetails = new ApiDetails(null, null, null, null, null); |
||
30 | $this->assertNull($apiDetails->getRefreshToken()); |
||
31 | $apiDetails->setRefreshToken($refreshToken); |
||
32 | $this->assertEquals($refreshToken, $apiDetails->getRefreshToken()); |
||
33 | $this->assertNull($apiDetails->getClientId()); |
||
34 | $this->assertNull($apiDetails->getSecret()); |
||
35 | $this->assertNull($apiDetails->getRedirectUri()); |
||
36 | $this->assertNull($apiDetails->getDevToken()); |
||
37 | } |
||
38 | } |
||
39 |