File tree 3 files changed +61
-0
lines changed
3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ public function get(array $data)
28
28
return $ response ['Iteration ' ];
29
29
}
30
30
31
+ public function update (array $ data )
32
+ {
33
+ $ this ->validate ($ data , [
34
+ 'ProjectName ' => 'string|required ' ,
35
+ 'IterationCode ' => 'integer|required ' ,
36
+ 'Name ' => 'nullable|string ' ,
37
+ 'Goal ' => 'nullable|string ' ,
38
+ 'Assignee ' => 'nullable|integer ' ,
39
+ 'StartAt ' => 'nullable|date_format:Y-m-d ' ,
40
+ 'EndAt ' => 'nullable|date_format:Y-m-d|after:StartAt ' ,
41
+ ]);
42
+ $ response = $ this ->core ->request ('ModifyIteration ' , $ data );
43
+ return $ response ['Iteration ' ];
44
+ }
45
+
31
46
public function delete (array $ data )
32
47
{
33
48
$ this ->validate ($ data , [
Original file line number Diff line number Diff line change @@ -123,6 +123,28 @@ public function testGet()
123
123
$ this ->assertEquals ($ response ['Iteration ' ], $ result );
124
124
}
125
125
126
+ public function testUpdate ()
127
+ {
128
+ $ response = json_decode (
129
+ file_get_contents ($ this ->dataPath ('ModifyIterationResponse.json ' )),
130
+ true
131
+ )['Response ' ];
132
+ $ data = [
133
+ 'ProjectName ' => $ this ->projectName ,
134
+ 'IterationCode ' => $ this ->faker ->randomNumber (),
135
+ 'Goal ' => $ this ->faker ->sentence ,
136
+ ];
137
+ $ this ->coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
138
+ 'ModifyIteration ' ,
139
+ $ data
140
+ ])->andReturn ($ response );
141
+
142
+ $ iteration = new Iteration ('' , $ this ->coreMock );
143
+ $ iteration ->setToken ($ this ->token );
144
+ $ result = $ iteration ->update ($ data );
145
+ $ this ->assertEquals ($ response ['Iteration ' ], $ result );
146
+ }
147
+
126
148
public function testDelete ()
127
149
{
128
150
$ response = json_decode (
Original file line number Diff line number Diff line change
1
+ {
2
+ "Response" : {
3
+ "Iteration" : {
4
+ "Assignee" : 0 ,
5
+ "Code" : 20 ,
6
+ "CompletedCount" : 0 ,
7
+ "CompletedPercent" : 0 ,
8
+ "Completer" : 0 ,
9
+ "CreatedAt" : 1640921166000 ,
10
+ "Creator" : 183478 ,
11
+ "Deleter" : 0 ,
12
+ "EndAt" : -28800000 ,
13
+ "Goal" : " foo" ,
14
+ "Name" : " sprint 666" ,
15
+ "ProcessingCount" : 0 ,
16
+ "StartAt" : -28800000 ,
17
+ "Starter" : 0 ,
18
+ "Status" : " WAIT_PROCESS" ,
19
+ "UpdatedAt" : 1640921166000 ,
20
+ "WaitProcessCount" : 0
21
+ },
22
+ "RequestId" : " 0761cb2d-601c-1db3-f796-73b03d28fe85"
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments