summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
authorRafael de Camargo <rafaelcamargo@trt15.jus.br>2019-05-14 02:34:53 -0300
committerfguillot <fred@kanboard.net>2019-05-13 22:34:52 -0700
commitd5f6317608376bf55351185a76bb3d8817af1e2d (patch)
tree477f5d51545a0e5b7644e1c3b894c41a5a30faf1 /tests/units
parent702379a55093aa62bae7dcd49a657397a21fd6b5 (diff)
Do not show duplicated results when multiple comments match
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/Filter/TaskCommentFilterTest.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/units/Filter/TaskCommentFilterTest.php b/tests/units/Filter/TaskCommentFilterTest.php
index 95ffb32f..e6e20cbe 100644
--- a/tests/units/Filter/TaskCommentFilterTest.php
+++ b/tests/units/Filter/TaskCommentFilterTest.php
@@ -21,8 +21,10 @@ class TaskCommentFilterTest extends Base
$this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
$this->assertEquals(1, $taskCreation->create(array('title' => 'Test', 'project_id' => 1)));
$this->assertEquals(1, $commentModel->create(array('task_id' => 1, 'user_id' => 1, 'comment' => 'This is a test')));
+ $this->assertEquals(2, $commentModel->create(array('task_id' => 1, 'user_id' => 1, 'comment' => 'This is another test')));
$filter = new TaskCommentFilter();
+ $filter->setDatabase($this->container['db']);
$filter->withQuery($query);
$filter->withValue('test');
$filter->apply();
@@ -43,6 +45,7 @@ class TaskCommentFilterTest extends Base
$this->assertEquals(1, $commentModel->create(array('task_id' => 1, 'user_id' => 1, 'comment' => 'This is a test')));
$filter = new TaskCommentFilter();
+ $filter->setDatabase($this->container['db']);
$filter->withQuery($query);
$filter->withValue('foobar');
$filter->apply();