Check if the start date is before due date

This commit is contained in:
Frederic Guillot
2017-11-09 11:17:07 -08:00
parent d8e88582f7
commit a12e159de0
32 changed files with 83 additions and 36 deletions

View File

@@ -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]);
}
}