File tree 3 files changed +54
-0
lines changed
3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,14 @@ public function create(array $data)
17
17
$ response = $ this ->core ->request ('CreateIteration ' , $ data );
18
18
return $ response ['Iteration ' ];
19
19
}
20
+
21
+ public function get (array $ data )
22
+ {
23
+ $ this ->validate ($ data , [
24
+ 'ProjectName ' => 'string|required ' ,
25
+ 'IterationCode ' => 'integer|required ' ,
26
+ ]);
27
+ $ response = $ this ->core ->request ('DescribeIteration ' , $ data );
28
+ return $ response ['Iteration ' ];
29
+ }
20
30
}
Original file line number Diff line number Diff line change @@ -102,4 +102,24 @@ public function testCreateFailedBefore()
102
102
$ this ->expectExceptionMessage ('The end at must be a date after start at. ' );
103
103
$ iteration ->create ($ data );
104
104
}
105
+
106
+ public function testGet ()
107
+ {
108
+ $ response = json_decode (
109
+ file_get_contents ($ this ->dataPath ('DescribeIterationResponse.json ' )),
110
+ true
111
+ )['Response ' ];
112
+ $ data = [
113
+ 'ProjectName ' => $ this ->projectName ,
114
+ 'IterationCode ' => $ this ->faker ->randomNumber (),
115
+ ];
116
+ $ this ->coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
117
+ 'DescribeIteration ' ,
118
+ $ data
119
+ ])->andReturn ($ response );
120
+
121
+ $ iteration = new Iteration ($ this ->token , $ this ->coreMock );
122
+ $ result = $ iteration ->get ($ data );
123
+ $ this ->assertEquals ($ response ['Iteration ' ], $ result );
124
+ }
105
125
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "Response" : {
3
+ "Iteration" : {
4
+ "Assignee" : 0 ,
5
+ "Code" : 10 ,
6
+ "CompletedCount" : 0 ,
7
+ "CompletedPercent" : 0 ,
8
+ "Completer" : 0 ,
9
+ "CreatedAt" : 1640672501000 ,
10
+ "Creator" : 183478 ,
11
+ "Deleter" : 0 ,
12
+ "EndAt" : -28800000 ,
13
+ "Goal" : " " ,
14
+ "Name" : " sprint 1" ,
15
+ "ProcessingCount" : 0 ,
16
+ "StartAt" : -28800000 ,
17
+ "Starter" : 0 ,
18
+ "Status" : " WAIT_PROCESS" ,
19
+ "UpdatedAt" : 1640672501000 ,
20
+ "WaitProcessCount" : 0
21
+ },
22
+ "RequestId" : " 78bb5b45-acc9-7ccc-edfc-a802f473b169"
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments