From 17a3781bd8c03e6b653104dbcb996a1ff1213959 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 14 Aug 2015 17:03:55 -0400 Subject: Add Gantt chart for projects --- tests/units/TaskCreationTest.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests/units') diff --git a/tests/units/TaskCreationTest.php b/tests/units/TaskCreationTest.php index 2dc67ad4..a77778d6 100644 --- a/tests/units/TaskCreationTest.php +++ b/tests/units/TaskCreationTest.php @@ -289,20 +289,21 @@ class TaskCreationTest extends Base $this->assertEquals(1, $p->create(array('name' => 'test'))); $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'test', 'date_due' => $date))); $this->assertEquals(2, $tc->create(array('project_id' => 1, 'title' => 'test', 'date_due' => $timestamp))); + $this->assertEquals(3, $tc->create(array('project_id' => 1, 'title' => 'test', 'date_due' => ''))); $task = $tf->getById(1); $this->assertNotEmpty($task); - $this->assertNotFalse($task); - $this->assertEquals(1, $task['id']); $this->assertEquals($date, date('Y-m-d', $task['date_due'])); $task = $tf->getById(2); $this->assertNotEmpty($task); - $this->assertNotFalse($task); - $this->assertEquals(2, $task['id']); $this->assertEquals($timestamp, $task['date_due']); + + $task = $tf->getById(3); + $this->assertEquals(3, $task['id']); + $this->assertEquals(0, $task['date_due']); } public function testDateStarted() @@ -336,6 +337,11 @@ class TaskCreationTest extends Base $task = $tf->getById(4); $this->assertEquals(time(), $task['date_started'], '', 1); + + // Set empty string + $this->assertEquals(5, $tc->create(array('project_id' => 1, 'title' => 'test', 'date_started' => ''))); + $task = $tf->getById(5); + $this->assertEquals(0, $task['date_started']); } public function testTime() -- cgit v1.2.3