summaryrefslogtreecommitdiff
path: root/tests/units/Model/TaskModelTest.php
diff options
context:
space:
mode:
authorTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
committerTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
commitfe8e9cdcfe3afc1475c7e7f4392d2b2cc601a12b (patch)
tree001403874e9e3716de7c6d51a9f536e9b3c3be5e /tests/units/Model/TaskModelTest.php
parentb1e795fc5b45369f7b9b565b1e106d2673361977 (diff)
parent98efcf21e355ed6ac3827058b99df86ca67c75bb (diff)
Merge branch 'stable' of https://github.com/kanboard/kanboard
Diffstat (limited to 'tests/units/Model/TaskModelTest.php')
-rw-r--r--tests/units/Model/TaskModelTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/units/Model/TaskModelTest.php b/tests/units/Model/TaskModelTest.php
new file mode 100644
index 00000000..e42b5ae6
--- /dev/null
+++ b/tests/units/Model/TaskModelTest.php
@@ -0,0 +1,30 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Kanboard\Model\TaskModel;
+use Kanboard\Model\TaskCreationModel;
+use Kanboard\Model\ProjectModel;
+
+class TaskModelTest extends Base
+{
+ public function testRemove()
+ {
+ $taskModel = new TaskModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+ $projectModel = new ProjectModel($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'UnitTest')));
+ $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task #1', 'project_id' => 1)));
+
+ $this->assertTrue($taskModel->remove(1));
+ $this->assertFalse($taskModel->remove(1234));
+ }
+
+ public function testGetTaskIdFromText()
+ {
+ $taskModel = new TaskModel($this->container);
+ $this->assertEquals(123, $taskModel->getTaskIdFromText('My task #123'));
+ $this->assertEquals(0, $taskModel->getTaskIdFromText('My task 123'));
+ }
+}