diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-03-19 17:05:28 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-03-19 17:05:28 -0400 |
commit | b27a7db35465817afd54aa2af99446e9a13ffd76 (patch) | |
tree | 3a7950e2723249d36bf572593f1467a6e3c86d3c /tests | |
parent | d915c2a96b0cbb54b9949cc04495d156e1f89332 (diff) |
Do not list private projects when adding a new user
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Model/ProjectModelTest.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/units/Model/ProjectModelTest.php b/tests/units/Model/ProjectModelTest.php index 1f65cad7..03ba708e 100644 --- a/tests/units/Model/ProjectModelTest.php +++ b/tests/units/Model/ProjectModelTest.php @@ -354,4 +354,17 @@ class ProjectModelTest extends Base $this->assertEquals('', $project['owner_username']); $this->assertEquals(0, $project['owner_id']); } + + public function testGetList() + { + $projectModel = new ProjectModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Project B'), 1)); + $this->assertEquals(2, $projectModel->create(array('name' => 'Project A', 'is_private' => 1), 1)); + + $this->assertEquals(array(0 => 'None', 1 => 'Project B'), $projectModel->getList()); + $this->assertEquals(array(1 => 'Project B'), $projectModel->getList(false)); + $this->assertEquals(array(2 => 'Project A', 1 => 'Project B'), $projectModel->getList(false, false)); + $this->assertEquals(array(0 => 'None', 2 => 'Project A', 1 => 'Project B'), $projectModel->getList(true, false)); + } } |