summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2019-07-17 14:45:09 -0700
committerFrédéric Guillot <fred@kanboard.net>2019-07-17 15:27:12 -0700
commit051c36f597fddb791ac156aa27f995248f0d2c0a (patch)
tree9f4568c26c7b4ce1b1f0edf266ba7be5d95c5427 /tests
parentff53a6aa6bd31bdb8fbdeef4865507ae502ea386 (diff)
Add support for reference:none
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Filter/TaskReferenceFilterTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/units/Filter/TaskReferenceFilterTest.php b/tests/units/Filter/TaskReferenceFilterTest.php
index 49a86454..016f69c4 100644
--- a/tests/units/Filter/TaskReferenceFilterTest.php
+++ b/tests/units/Filter/TaskReferenceFilterTest.php
@@ -62,4 +62,23 @@ class TaskReferenceFilterTest extends Base
$this->assertCount(1, $query->findAll());
}
+
+ public function testWithNone()
+ {
+ $taskFinder = new TaskFinderModel($this->container);
+ $taskCreation = new TaskCreationModel($this->container);
+ $projectModel = new ProjectModel($this->container);
+ $query = $taskFinder->getExtendedQuery();
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
+ $this->assertEquals(1, $taskCreation->create(array('title' => 'A', 'project_id' => 1, 'reference' => 'aaa-bbb')));
+ $this->assertEquals(2, $taskCreation->create(array('title' => 'B', 'project_id' => 1)));
+
+ $filter = new TaskReferenceFilter();
+ $filter->withQuery($query);
+ $filter->withValue('none');
+ $filter->apply();
+
+ $this->assertCount(1, $query->findAll());
+ }
}