2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ class ClosedTimeByStatusFieldDispatcher implements ClosedTimeDispatcher {
7
7
8
8
public function isClosingTransaction (array $ transaction )
9
9
{
10
- return $ transaction ['transactionType ' ] === 'status '
11
- && in_array ($ transaction ['oldValue ' ], self ::$ STATUS_OPEN )
12
- && !in_array ($ transaction ['newValue ' ], self ::$ STATUS_OPEN );
10
+ if ($ transaction ['transactionType ' ] === 'status ' ) {
11
+ return in_array ($ transaction ['oldValue ' ], self ::$ STATUS_OPEN ) &&
12
+ !in_array ($ transaction ['newValue ' ], self ::$ STATUS_OPEN );
13
+ }
14
+
15
+ return $ transaction ['transactionType ' ] === 'mergedinto ' ;
13
16
}
14
17
}
Original file line number Diff line number Diff line change @@ -229,4 +229,19 @@ public function testOpenTaskTransactionsAreIgnored()
229
229
230
230
$ this ->assertNull ($ burndown ->getPointsClosedBeforeSprint ());
231
231
}
232
+
233
+ public function testClosedPerDayDetectsMergedTasks ()
234
+ {
235
+ $ burndown = $ this ->mockWithTransactions (
236
+ $ this ->tasks ,
237
+ [
238
+ '1 ' => [[
239
+ 'transactionType ' => 'mergedinto ' ,
240
+ 'dateCreated ' => '1418040000 ' , // Dec 8
241
+ ]],
242
+ ]
243
+ );
244
+
245
+ $ this ->assertSame (8 , $ burndown ->getPointsClosedPerDay ()['2014-12-08 ' ]);
246
+ }
232
247
}
0 commit comments