Completed
Push — master ( 47d2ac...3fd795 )
by Marijn
22s
created

ApiDetailsTest::testSetRefreshToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
namespace Test\Werkspot\BingAdsApiBundle\Model;
3
4
use PHPUnit_Framework_TestCase;
5
use Werkspot\BingAdsApiBundle\Model\ApiDetails;
6
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