diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-02-20 15:42:15 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-02-20 15:42:15 -0500 |
commit | da7259819bb6c3947317b39fc2a10626471bfca3 (patch) | |
tree | 9d8231b40dc9ad23c1176241872af3edc405d875 /tests | |
parent | 0261c751cf539030f47756bc1ea1650123ed2312 (diff) |
Rewrite assertion to avoid false positive on the CI
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php b/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php index 9c445dca..b8faec6c 100644 --- a/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php +++ b/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php @@ -37,15 +37,12 @@ class AverageLeadCycleTimeAnalyticTest extends Base $this->container['db']->table(Task::TABLE)->eq('id', 4)->update(array('date_completed' => $now + 2 * 3600)); $stats = $averageLeadCycleTimeAnalytic->build(1); - $expected = array( - 'count' => 4, - 'total_lead_time' => 3600 + 1800 + 3600 + 2*3600, - 'total_cycle_time' => 1800 + 900, - 'avg_lead_time' => (3600 + 1800 + 3600 + 2*3600) / 4, - 'avg_cycle_time' => (1800 + 900) / 4, - ); - $this->assertEquals($expected, $stats); + $this->assertEquals(4, $stats['count']); + $this->assertEquals(3600 + 1800 + 3600 + 2*3600, $stats['total_lead_time'], '', 5); + $this->assertEquals(1800 + 900, $stats['total_cycle_time'], '', 5); + $this->assertEquals((3600 + 1800 + 3600 + 2*3600) / 4, $stats['avg_lead_time'], '', 5); + $this->assertEquals((1800 + 900) / 4, $stats['avg_cycle_time'], '', 5); } public function testBuildWithNoTasks() |