From aeab662d65cdadc044b89c332591b1f1d5b90823 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Oct 2015 14:09:52 -0400 Subject: Fix bug with due date greater than year 2038 See: https://en.wikipedia.org/wiki/Year_2038_problem --- tests/units/Model/TaskCreationTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/units/Model/TaskCreationTest.php b/tests/units/Model/TaskCreationTest.php index f292c7f1..2a9ced2d 100644 --- a/tests/units/Model/TaskCreationTest.php +++ b/tests/units/Model/TaskCreationTest.php @@ -413,4 +413,18 @@ class TaskCreationTest extends Base $this->assertNotEmpty($task); $this->assertEquals('orange', $task['color_id']); } + + public function testDueDateYear2038TimestampBug() + { + $p = new Project($this->container); + $tc = new TaskCreation($this->container); + $tf = new TaskFinder($this->container); + + $this->assertEquals(1, $p->create(array('name' => 'test'))); + $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'test', 'date_due' => strtotime('2050-01-10 12:30')))); + + $task = $tf->getById(1); + $this->assertNotEmpty($task); + $this->assertEquals('2050-01-10 12:30', date('Y-m-d H:i', $task['date_due'])); + } } -- cgit v1.2.3