summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-22 20:58:46 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-22 20:58:46 -0400
commit2425fd85c04e7ad6e571da1848bb8d4b54499394 (patch)
tree99111007b0ff53c4ef8d0ea728de34ceb64b5b42
parent8768a4e3699c5b9235d8c834ad7689ae66ef36aa (diff)
Force integer type for aggregated metrics
-rw-r--r--ChangeLog1
-rw-r--r--app/Model/ProjectDailyColumnStats.php2
-rw-r--r--tests/units/Model/ProjectDailyColumnStatsTest.php4
3 files changed, 4 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 18526e4e..54a28db7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ Improvements:
Bug fixes:
+* Force integer type for aggregated metrics (Burndown chart concat values instead of summing)
* Fixes cycle time calculation when the start date is defined in the future
* Access allowed to any tasks from the shared public board by changing the URL parameters
* Fix invalid user filter for API procedure createLdapUser()
diff --git a/app/Model/ProjectDailyColumnStats.php b/app/Model/ProjectDailyColumnStats.php
index 2bcc4d55..0706a110 100644
--- a/app/Model/ProjectDailyColumnStats.php
+++ b/app/Model/ProjectDailyColumnStats.php
@@ -165,7 +165,7 @@ class ProjectDailyColumnStats extends Base
{
foreach ($metrics as $metric) {
if ($metric['day'] === $day && $metric['column_id'] == $column_id) {
- return $metric[$field];
+ return (int) $metric[$field];
}
}
diff --git a/tests/units/Model/ProjectDailyColumnStatsTest.php b/tests/units/Model/ProjectDailyColumnStatsTest.php
index 1a0e826c..4f92ad2b 100644
--- a/tests/units/Model/ProjectDailyColumnStatsTest.php
+++ b/tests/units/Model/ProjectDailyColumnStatsTest.php
@@ -244,7 +244,7 @@ class ProjectDailyColumnStatsTest extends Base
array('2016-01-18', 4, 5, 3, 0),
);
- $this->assertEquals($expected, $projectDailyColumnStats->getAggregatedMetrics(1, '2016-01-16', '2016-01-18'));
+ $this->assertSame($expected, $projectDailyColumnStats->getAggregatedMetrics(1, '2016-01-16', '2016-01-18'));
$expected = array(
array('Date', 'Backlog', 'Ready', 'Work in progress', 'Done'),
@@ -253,7 +253,7 @@ class ProjectDailyColumnStatsTest extends Base
array('2016-01-18', 11, 14, 1, 0),
);
- $this->assertEquals($expected, $projectDailyColumnStats->getAggregatedMetrics(1, '2016-01-16', '2016-01-18', 'score'));
+ $this->assertSame($expected, $projectDailyColumnStats->getAggregatedMetrics(1, '2016-01-16', '2016-01-18', 'score'));
}
private function createTasks($column_id, $score, $is_active)