-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProjectGetIssueTypesCommandTest.php
More file actions
executable file
·39 lines (33 loc) · 1.24 KB
/
ProjectGetIssueTypesCommandTest.php
File metadata and controls
executable file
·39 lines (33 loc) · 1.24 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
<?php
namespace Tests\Feature;
use Coding\ProjectSetting;
use Tests\TestCase;
class ProjectGetIssueTypesCommandTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$codingToken = $this->faker->md5;
config(['coding.token' => $codingToken]);
$codingTeamDomain = $this->faker->domainWord;
config(['coding.team_domain' => $codingTeamDomain]);
$codingProjectUri = $this->faker->slug;
config(['coding.project_uri' => $codingProjectUri]);
}
public function testCreateSuccess()
{
$mock = \Mockery::mock(ProjectSetting::class, [])->makePartial();
$this->instance(ProjectSetting::class, $mock);
$mock->shouldReceive('getIssueTypes')->times(1)->andReturn(json_decode(
file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueTypeListResponse.json'),
true
)['Response']['IssueTypes']);
$this->artisan('project:get-issue-types')
->expectsOutput('213217 史诗')
->expectsOutput('213218 用户故事')
->expectsOutput('213220 任务')
->expectsOutput('213221 缺陷')
->expectsOutput('213222 子工作项')
->assertExitCode(0);
}
}