summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-15 20:49:06 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-15 20:49:06 -0500
commit1537f1b025c39fe432a8ca8aed5944b46e853f61 (patch)
treee5a0b589843f44ba36f50fe2940c5112e2738473 /tests
parentd6d1df291713b8bad114c70905dc9adad9e5dcbe (diff)
Add unit test for PR #3040
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Pagination/SubtaskPaginationTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/units/Pagination/SubtaskPaginationTest.php b/tests/units/Pagination/SubtaskPaginationTest.php
index 26a51a8b..1e16c985 100644
--- a/tests/units/Pagination/SubtaskPaginationTest.php
+++ b/tests/units/Pagination/SubtaskPaginationTest.php
@@ -1,5 +1,6 @@
<?php
+use Kanboard\Model\ColumnModel;
use Kanboard\Model\ProjectModel;
use Kanboard\Model\SubtaskModel;
use Kanboard\Model\TaskCreationModel;
@@ -33,4 +34,20 @@ class SubtaskPaginationTest extends Base
$this->assertCount(3, $subtaskPagination->getDashboardPaginator(1, 'subtasks', 5)->setOrder('task_name')->getCollection());
$this->assertCount(3, $subtaskPagination->getDashboardPaginator(1, 'subtasks', 5)->setOrder(SubtaskModel::TABLE.'.title')->getCollection());
}
+
+ public function testWhenColumnIsHidden()
+ {
+ $columnModel = new ColumnModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+ $projectModel = new ProjectModel($this->container);
+ $subtaskModel = new SubtaskModel($this->container);
+ $subtaskPagination = new SubtaskPagination($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'Project #1')));
+ $this->assertTrue($columnModel->update(1, 'test', 0, '', 1));
+ $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
+ $this->assertEquals(1, $subtaskModel->create(array('task_id' => 1, 'title' => 'subtask #1', 'user_id' => 1)));
+
+ $this->assertCount(0, $subtaskPagination->getDashboardPaginator(1, 'subtasks', 5)->getCollection());
+ }
}