From b27a7db35465817afd54aa2af99446e9a13ffd76 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 19 Mar 2017 17:05:28 -0400 Subject: Do not list private projects when adding a new user --- tests/units/Model/ProjectModelTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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)); + } } -- cgit v1.2.3