summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-09 11:17:07 -0800
committerFrederic Guillot <fred@kanboard.net>2017-11-09 11:17:07 -0800
commita12e159de06b2a09c9e6cfd6cab47392c7b7f3f6 (patch)
tree7f99975283f6b04c98d167cc89a02219b6e5e07a /tests
parentd8e88582f776842ad510f0a42e4705d672c0c277 (diff)
Check if the start date is before due date
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Validator/TaskValidatorTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/units/Validator/TaskValidatorTest.php b/tests/units/Validator/TaskValidatorTest.php
index 0c7fead7..fd5e41fe 100644
--- a/tests/units/Validator/TaskValidatorTest.php
+++ b/tests/units/Validator/TaskValidatorTest.php
@@ -67,4 +67,18 @@ class TaskValidatorTest extends Base
$result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'swimlane_id' => 0));
$this->assertFalse($result[0]);
}
+
+ public function testStartAndDueDateFields()
+ {
+ $taskValidator = new TaskValidator($this->container);
+
+ $result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'date_due' => '09/11/2017 10:50', 'date_started' => '09/11/2017 9:50'));
+ $this->assertTrue($result[0]);
+
+ $result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'date_due' => '09/11/2017 10:50', 'date_started' => '09/11/2017 10:50'));
+ $this->assertTrue($result[0]);
+
+ $result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'date_due' => '09/11/2017 10:50', 'date_started' => '09/11/2017 11:50'));
+ $this->assertFalse($result[0]);
+ }
}