-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectSettingTest.php
More file actions
50 lines (44 loc) · 1.58 KB
/
ProjectSettingTest.php
File metadata and controls
50 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace Tests\Unit;
use Coding\Issue;
use Coding\ProjectSetting;
use Tests\TestCase;
class ProjectSettingTest extends TestCase
{
public function testGetIssueTypes()
{
$response = json_decode(
file_get_contents($this->dataPath('DescribeProjectIssueTypeListResponse.json')),
true
)['Response'];
$data = [
'ProjectName' => $this->projectName,
];
$this->coreMock->shouldReceive('request')->times(1)->withArgs([
'DescribeProjectIssueTypeList',
$data
])->andReturn($response);
$projectSetting = new ProjectSetting($this->token, $this->coreMock);
$result = $projectSetting->getIssueTypes($data);
$this->assertEquals($response['IssueTypes'], $result);
}
public function testGetIssueStatus()
{
$response = json_decode(
file_get_contents($this->dataPath('DescribeProjectIssueStatusListResponse.json')),
true
)['Response'];
$data = [
'ProjectName' => $this->projectName,
'IssueType' => $this->faker->randomElement(Issue::TYPE),
'IssueTypeId' => $this->faker->randomNumber(),
];
$this->coreMock->shouldReceive('request')->times(1)->withArgs([
'DescribeProjectIssueStatusList',
$data
])->andReturn($response);
$projectSetting = new ProjectSetting($this->token, $this->coreMock);
$result = $projectSetting->getIssueStatus($data);
$this->assertEquals($response['ProjectIssueStatusList'], $result);
}
}