summaryrefslogtreecommitdiff
path: root/tests/units/Model
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-06 18:08:41 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-06 18:08:41 -0500
commit58cef289674717027b6b470044504a661f3bd9ad (patch)
treebf3be866b414009b60b1e1f16480a84c91da03de /tests/units/Model
parentfc785bbbf6cc7db01964ae1d99cd02e85afeedc2 (diff)
The date time format can be chosen in application settings
Diffstat (limited to 'tests/units/Model')
-rw-r--r--tests/units/Model/TaskCreationTest.php4
-rw-r--r--tests/units/Model/TaskDuplicationTest.php6
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/units/Model/TaskCreationTest.php b/tests/units/Model/TaskCreationTest.php
index 19b3b0d1..781a7147 100644
--- a/tests/units/Model/TaskCreationTest.php
+++ b/tests/units/Model/TaskCreationTest.php
@@ -295,7 +295,7 @@ class TaskCreationTest extends Base
$task = $tf->getById(2);
$this->assertNotEmpty($task);
$this->assertEquals(2, $task['id']);
- $this->assertEquals($timestamp, $task['date_due']);
+ $this->assertEquals(date('Y-m-d 00:00', $timestamp), date('Y-m-d 00:00', $task['date_due']));
$task = $tf->getById(3);
$this->assertEquals(3, $task['id']);
@@ -422,6 +422,6 @@ class TaskCreationTest extends Base
$task = $tf->getById(1);
$this->assertNotEmpty($task);
- $this->assertEquals('2050-01-10 12:30', date('Y-m-d H:i', $task['date_due']));
+ $this->assertEquals('2050-01-10 00:00', date('Y-m-d H:i', $task['date_due']));
}
}
diff --git a/tests/units/Model/TaskDuplicationTest.php b/tests/units/Model/TaskDuplicationTest.php
index 798b3835..8649c6b0 100644
--- a/tests/units/Model/TaskDuplicationTest.php
+++ b/tests/units/Model/TaskDuplicationTest.php
@@ -2,6 +2,7 @@
require_once __DIR__.'/../Base.php';
+use Kanboard\Core\DateParser;
use Kanboard\Model\Task;
use Kanboard\Model\TaskCreation;
use Kanboard\Model\TaskDuplication;
@@ -665,6 +666,7 @@ class TaskDuplicationTest extends Base
$tf = new TaskFinder($this->container);
$p = new Project($this->container);
$c = new Category($this->container);
+ $dp = new DateParser($this->container);
$this->assertEquals(1, $p->create(array('name' => 'test1')));
@@ -685,7 +687,7 @@ class TaskDuplicationTest extends Base
$this->assertNotEmpty($task);
$this->assertEquals(Task::RECURRING_STATUS_PROCESSED, $task['recurrence_status']);
$this->assertEquals(2, $task['recurrence_child']);
- $this->assertEquals(1436561776, $task['date_due'], '', 2);
+ $this->assertEquals(1436486400, $task['date_due'], '', 2);
$task = $tf->getById(2);
$this->assertNotEmpty($task);
@@ -695,6 +697,6 @@ class TaskDuplicationTest extends Base
$this->assertEquals(Task::RECURRING_BASEDATE_TRIGGERDATE, $task['recurrence_basedate']);
$this->assertEquals(1, $task['recurrence_parent']);
$this->assertEquals(2, $task['recurrence_factor']);
- $this->assertEquals(strtotime('+2 days'), $task['date_due'], '', 2);
+ $this->assertEquals($dp->removeTimeFromTimestamp(strtotime('+2 days')), $task['date_due'], '', 2);
}
}