Test Setup Failed
Push — master ( 332ec9...f749ef )
by Ilham
03:19
created

AccessTokenTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetCredentials() 0 12 1
A testEndpoint() 0 3 1
1
<?php
2
/**
3
 * This file is part of the dingtalk.
4
 * User: Ilham Tahir <[email protected]>
5
 * This source file is subject to the MIT license that is bundled
6
 * with this source code in the file LICENSE.
7
 */
8
9
namespace Aplisin\DingTalk\Tests\Auth;
10
11
use Aplisin\DingTalk\Kernel\ServiceContainer;
12
use Aplisin\DingTalk\Tests\BaseCase;
13
use Aplisin\DingTalk\Auth\AccessToken;
14
15
class AccessTokenTest extends BaseCase
16
{
17
    public function testGetCredentials()
18
    {
19
        $app = new ServiceContainer([
20
            'corp_id' => '1234',
21
            'secret' => 'secret',
22
        ]);
23
24
        $accessToken = \Mockery::mock(AccessToken::class, [$app])->makePartial()->shouldAllowMockingProtectedMethods();
25
        $this->assertSame([
26
            'corpid' => '1234',
27
            'corpsecret' => 'secret',
28
        ], $accessToken->getCredentials());
29
    }
30
31
    public function testEndpoint()
32
    {
33
        $this->assertSame('/gettoken', (new AccessToken(new ServiceContainer()))->getEndpoint());
34
    }
35
}
36