Skip to content

Commit d2c4939

Browse files
committedAug 14, 2015
Merge pull request phacility#132 from wmde/mergedinto
Consider merged tasks as done
2 parents 3fb19c6 + ac550b3 commit d2c4939

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed
 

‎app/Phragile/ClosedTimeByStatusFieldDispatcher.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ class ClosedTimeByStatusFieldDispatcher implements ClosedTimeDispatcher {
77

88
public function isClosingTransaction(array $transaction)
99
{
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';
1316
}
1417
}

‎tests/unit/BurndownChartTest.php

+15
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,19 @@ public function testOpenTaskTransactionsAreIgnored()
229229

230230
$this->assertNull($burndown->getPointsClosedBeforeSprint());
231231
}
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+
}
232247
}

0 commit comments

Comments
 (0)
Failed to load comments.