diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-03 14:09:52 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-03 14:09:52 -0400 |
commit | aeab662d65cdadc044b89c332591b1f1d5b90823 (patch) | |
tree | 2f6ef1541b70aa0bc1feb03a5e548bedb6e19bae /tests/units/Model | |
parent | a41d580a464544d8cbba007802bcc14a3627c1ba (diff) |
Fix bug with due date greater than year 2038
See: https://en.wikipedia.org/wiki/Year_2038_problem
Diffstat (limited to 'tests/units/Model')
-rw-r--r-- | tests/units/Model/TaskCreationTest.php | 14 |
1 files changed, 14 insertions, 0 deletions
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'])); + } } |