diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-31 21:04:22 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-31 21:04:22 -0400 |
commit | 3861e90336031873d7f6dc2f7476b5502af7d69f (patch) | |
tree | 6cfcf590b3dd307e639025e5cd272d57232245ba /tests/units/Model | |
parent | 12acf66ad2a2673dd3201c85d4179b6c46f3c12f (diff) |
Fix wrong project date format (shown as 01/01/1970)
Diffstat (limited to 'tests/units/Model')
-rw-r--r-- | tests/units/Model/ProjectModelTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/units/Model/ProjectModelTest.php b/tests/units/Model/ProjectModelTest.php index 81e0dd57..cd86b654 100644 --- a/tests/units/Model/ProjectModelTest.php +++ b/tests/units/Model/ProjectModelTest.php @@ -39,6 +39,24 @@ class ProjectModelTest extends Base $this->assertEquals(0, $project['is_private']); $this->assertEquals(time(), $project['last_modified'], '', 1); $this->assertEmpty($project['token']); + $this->assertEmpty($project['start_date']); + $this->assertEmpty($project['end_date']); + } + + public function testProjectDate() + { + $projectModel = new ProjectModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'UnitTest'))); + $this->assertTrue($projectModel->update(array( + 'id' => 1, + 'start_date' => '2016-08-31', + 'end_date' => '08/31/2016', + ))); + + $project = $projectModel->getById(1); + $this->assertEquals('2016-08-31', $project['start_date']); + $this->assertEquals('2016-08-31', $project['end_date']); } public function testCreationWithDuplicateName() |