Do not show duplicated results when multiple comments match

This commit is contained in:
Rafael de Camargo
2019-05-14 02:34:53 -03:00
committed by fguillot
parent 702379a550
commit d5f6317608
3 changed files with 50 additions and 4 deletions

View File

@@ -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();