From 8e56148a6dda1f6b1a78a759e69e600b79bdddd2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 2 Jul 2016 15:45:55 -0400 Subject: Make sure that tags are duplicated for recurring tasks --- tests/units/Model/TaskModelTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/units/Model/TaskModelTest.php (limited to 'tests/units/Model/TaskModelTest.php') 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 @@ +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')); + } +} -- cgit v1.2.3