summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
authorOliver Buchmann <o.buch91@gmail.com>2017-05-10 22:42:34 +0200
committerFrédéric Guillot <fred@kanboard.net>2017-05-10 16:42:34 -0400
commitdaf39ee16aa15572b92f96bd7cc3705305a50b9d (patch)
tree570baefc579f9b7df1fa0dd4156148e746a5313c /tests/units
parent136936ae3df66e8ffc49d721f0bb4de507506332 (diff)
Change Due Date to Due Timestamp fixes #919 (#3249)
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/Action/TaskAssignDueDateOnCreationTest.php2
-rw-r--r--tests/units/Export/TaskExportTest.php2
-rw-r--r--tests/units/Model/TaskCreationModelTest.php8
-rw-r--r--tests/units/Model/TaskModificationModelTest.php6
-rw-r--r--tests/units/Model/TaskRecurrenceModelTest.php4
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/units/Action/TaskAssignDueDateOnCreationTest.php b/tests/units/Action/TaskAssignDueDateOnCreationTest.php
index 26c0584e..64625d2c 100644
--- a/tests/units/Action/TaskAssignDueDateOnCreationTest.php
+++ b/tests/units/Action/TaskAssignDueDateOnCreationTest.php
@@ -32,6 +32,6 @@ class TaskAssignDueDateOnCreationTest extends Base
$task = $taskFinderModel->getById(1);
$this->assertNotEmpty($task);
- $this->assertEquals(date('Y-m-d', strtotime('+4days')), date('Y-m-d', $task['date_due']));
+ $this->assertEquals(date('Y-m-d H:i', strtotime('+4days')), date('Y-m-d H:i', $task['date_due']));
}
}
diff --git a/tests/units/Export/TaskExportTest.php b/tests/units/Export/TaskExportTest.php
index e8b347ac..8e0be433 100644
--- a/tests/units/Export/TaskExportTest.php
+++ b/tests/units/Export/TaskExportTest.php
@@ -70,7 +70,7 @@ class TaskExportTest extends Base
$this->assertEquals('Yellow', $report[2][8]);
$this->assertEquals('', $report[1][9]);
- $this->assertEquals(date('m/d/Y').' 00:00', $report[2][9]);
+ $this->assertEquals(date('m/d/Y H:i'), $report[2][9]);
$this->assertEquals(3, $report[1][21]);
$this->assertEquals(0, $report[2][21]);
diff --git a/tests/units/Model/TaskCreationModelTest.php b/tests/units/Model/TaskCreationModelTest.php
index ce9996d9..7723bece 100644
--- a/tests/units/Model/TaskCreationModelTest.php
+++ b/tests/units/Model/TaskCreationModelTest.php
@@ -248,7 +248,7 @@ class TaskCreationModelTest extends Base
public function testDateDue()
{
- $date = '2014-11-23';
+ $date = '2014-11-23 14:30';
$timestamp = strtotime('+2days');
$projectModel = new ProjectModel($this->container);
$taskCreationModel = new TaskCreationModel($this->container);
@@ -262,12 +262,12 @@ class TaskCreationModelTest extends Base
$task = $taskFinderModel->getById(1);
$this->assertNotEmpty($task);
$this->assertEquals(1, $task['id']);
- $this->assertEquals($date, date('Y-m-d', $task['date_due']));
+ $this->assertEquals($date, date('Y-m-d H:i', $task['date_due']));
$task = $taskFinderModel->getById(2);
$this->assertNotEmpty($task);
$this->assertEquals(2, $task['id']);
- $this->assertEquals(date('Y-m-d 00:00', $timestamp), date('Y-m-d 00:00', $task['date_due']));
+ $this->assertEquals(date('Y-m-d H:i', $timestamp), date('Y-m-d H:i', $task['date_due']));
$task = $taskFinderModel->getById(3);
$this->assertEquals(3, $task['id']);
@@ -398,6 +398,6 @@ class TaskCreationModelTest extends Base
$task = $taskFinderModel->getById(1);
$this->assertNotEmpty($task);
- $this->assertEquals('2050-01-10 00:00', date('Y-m-d H:i', $task['date_due']));
+ $this->assertEquals('2050-01-10 12:30', date('Y-m-d H:i', $task['date_due']));
}
}
diff --git a/tests/units/Model/TaskModificationModelTest.php b/tests/units/Model/TaskModificationModelTest.php
index f70561b3..a716cf3d 100644
--- a/tests/units/Model/TaskModificationModelTest.php
+++ b/tests/units/Model/TaskModificationModelTest.php
@@ -195,15 +195,15 @@ class TaskModificationModelTest extends Base
$task = $taskFinderModel->getById(1);
$this->assertEquals(0, $task['date_due']);
- $this->assertTrue($taskModificationModel->update(array('id' => 1, 'date_due' => '2014-11-24')));
+ $this->assertTrue($taskModificationModel->update(array('id' => 1, 'date_due' => '2014-11-24 14:30')));
$task = $taskFinderModel->getById(1);
- $this->assertEquals('2014-11-24', date('Y-m-d', $task['date_due']));
+ $this->assertEquals('2014-11-24 14:30', date('Y-m-d H:i', $task['date_due']));
$this->assertTrue($taskModificationModel->update(array('id' => 1, 'date_due' => time())));
$task = $taskFinderModel->getById(1);
- $this->assertEquals(date('Y-m-d'), date('Y-m-d', $task['date_due']));
+ $this->assertEquals(date('Y-m-d H:i'), date('Y-m-d H:i', $task['date_due']));
}
public function testChangeStartedDate()
diff --git a/tests/units/Model/TaskRecurrenceModelTest.php b/tests/units/Model/TaskRecurrenceModelTest.php
index 85d77bc2..56f6cf84 100644
--- a/tests/units/Model/TaskRecurrenceModelTest.php
+++ b/tests/units/Model/TaskRecurrenceModelTest.php
@@ -106,7 +106,7 @@ class TaskRecurrenceModelTest extends Base
$this->assertNotEmpty($task);
$this->assertEquals(TaskModel::RECURRING_STATUS_PROCESSED, $task['recurrence_status']);
$this->assertEquals(2, $task['recurrence_child']);
- $this->assertEquals(1436486400, $task['date_due'], '', 2);
+ $this->assertEquals(1436561776, $task['date_due'], '', 2);
$task = $taskFinderModel->getById(2);
$this->assertNotEmpty($task);
@@ -116,7 +116,7 @@ class TaskRecurrenceModelTest extends Base
$this->assertEquals(TaskModel::RECURRING_BASEDATE_TRIGGERDATE, $task['recurrence_basedate']);
$this->assertEquals(1, $task['recurrence_parent']);
$this->assertEquals(2, $task['recurrence_factor']);
- $this->assertEquals($dateParser->removeTimeFromTimestamp(strtotime('+2 days')), $task['date_due'], '', 2);
+ $this->assertEquals(strtotime('+2 days'), $task['date_due'], '', 2);
$tags = $taskTagModel->getList(2);
$this->assertCount(2, $tags);