Test Setup Failed
Push — master ( f749ef...c6b244 )
by Ilham
01:56
created

ClientTest::testListIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
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\Department;
10
11
use Aplisin\DingTalk\Department\Client;
12
use Aplisin\DingTalk\Tests\BaseCase;
13
14
class ClientTest extends BaseCase
15
{
16
    public function testListIds()
17
    {
18
        $client = $this->mockApiClient(Client::class);
19
        $client->expects()->httpGet('/department/list_ids', [
20
            'id' => 1
21
        ])->andReturn('mock-result')->once();
22
        $this->assertSame('mock-result', $client->listIds(1));
23
    }
24
25
    public function testList()
26
    {
27
        $client = $this->mockApiClient(Client::class);
28
        $client->expects()->httpGet('/department/list', [
29
            'id' => 1,
30
            'fetch_child' => false,
31
            'lang' => 'zh_CN'
32
        ])->andReturn('mock-result')->once();
33
        $this->assertSame('mock-result', $client->list(1));
34
    }
35
}
36