diff options
author | Teamjungla{CODE} <junglacode@gmail.com> | 2016-08-20 13:47:12 -0500 |
---|---|---|
committer | Teamjungla{CODE} <junglacode@gmail.com> | 2016-08-20 13:47:12 -0500 |
commit | fe8e9cdcfe3afc1475c7e7f4392d2b2cc601a12b (patch) | |
tree | 001403874e9e3716de7c6d51a9f536e9b3c3be5e /tests/units/Model/TaskTest.php | |
parent | b1e795fc5b45369f7b9b565b1e106d2673361977 (diff) | |
parent | 98efcf21e355ed6ac3827058b99df86ca67c75bb (diff) |
Merge branch 'stable' of https://github.com/kanboard/kanboard
Diffstat (limited to 'tests/units/Model/TaskTest.php')
-rw-r--r-- | tests/units/Model/TaskTest.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/units/Model/TaskTest.php b/tests/units/Model/TaskTest.php deleted file mode 100644 index 89fc4dc1..00000000 --- a/tests/units/Model/TaskTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -require_once __DIR__.'/../Base.php'; - -use Kanboard\Model\TaskModel; -use Kanboard\Model\TaskCreationModel; -use Kanboard\Model\ProjectModel; - -class TaskTest extends Base -{ - public function testRemove() - { - $t = new TaskModel($this->container); - $tc = new TaskCreationModel($this->container); - $p = new ProjectModel($this->container); - - $this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); - $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1))); - - $this->assertTrue($t->remove(1)); - $this->assertFalse($t->remove(1234)); - } - - public function testGetTaskIdFromText() - { - $t = new TaskModel($this->container); - $this->assertEquals(123, $t->getTaskIdFromText('My task #123')); - $this->assertEquals(0, $t->getTaskIdFromText('My task 123')); - } - - public function testRecurrenceSettings() - { - $t = new TaskModel($this->container); - - $statuses = $t->getRecurrenceStatusList(); - $this->assertCount(2, $statuses); - $this->assertArrayHasKey(TaskModel::RECURRING_STATUS_NONE, $statuses); - $this->assertArrayHasKey(TaskModel::RECURRING_STATUS_PENDING, $statuses); - $this->assertArrayNotHasKey(TaskModel::RECURRING_STATUS_PROCESSED, $statuses); - - $triggers = $t->getRecurrenceTriggerList(); - $this->assertCount(3, $triggers); - $this->assertArrayHasKey(TaskModel::RECURRING_TRIGGER_FIRST_COLUMN, $triggers); - $this->assertArrayHasKey(TaskModel::RECURRING_TRIGGER_LAST_COLUMN, $triggers); - $this->assertArrayHasKey(TaskModel::RECURRING_TRIGGER_CLOSE, $triggers); - - $dates = $t->getRecurrenceBasedateList(); - $this->assertCount(2, $dates); - $this->assertArrayHasKey(TaskModel::RECURRING_BASEDATE_DUEDATE, $dates); - $this->assertArrayHasKey(TaskModel::RECURRING_BASEDATE_TRIGGERDATE, $dates); - - $timeframes = $t->getRecurrenceTimeframeList(); - $this->assertCount(3, $timeframes); - $this->assertArrayHasKey(TaskModel::RECURRING_TIMEFRAME_DAYS, $timeframes); - $this->assertArrayHasKey(TaskModel::RECURRING_TIMEFRAME_MONTHS, $timeframes); - $this->assertArrayHasKey(TaskModel::RECURRING_TIMEFRAME_YEARS, $timeframes); - } -} |