summaryrefslogtreecommitdiff
path: root/tests/integration/ProjectPermissionTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /tests/integration/ProjectPermissionTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/ProjectPermissionTest.php')
-rw-r--r--tests/integration/ProjectPermissionTest.php89
1 files changed, 0 insertions, 89 deletions
diff --git a/tests/integration/ProjectPermissionTest.php b/tests/integration/ProjectPermissionTest.php
deleted file mode 100644
index 3ceda07d..00000000
--- a/tests/integration/ProjectPermissionTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class ProjectPermissionTest extends BaseIntegrationTest
-{
- protected $projectName = 'Project with permission';
- protected $username = 'user-project-permission';
- protected $groupName1 = 'My group A for project permission';
- protected $groupName2 = 'My group B for project permission';
-
- public function testAll()
- {
- $this->assertCreateTeamProject();
- $this->assertCreateGroups();
- $this->assertCreateUser();
-
- $this->assertAddProjectUser();
- $this->assertGetProjectUsers();
- $this->assertGetAssignableUsers();
- $this->assertChangeProjectUserRole();
- $this->assertRemoveProjectUser();
-
- $this->assertAddProjectGroup();
- $this->assertGetProjectUsers();
- $this->assertGetAssignableUsers();
- $this->assertChangeProjectGroupRole();
- $this->assertRemoveProjectGroup();
- }
-
- public function assertAddProjectUser()
- {
- $this->assertTrue($this->app->addProjectUser($this->projectId, $this->userId));
- }
-
- public function assertGetProjectUsers()
- {
- $members = $this->app->getProjectUsers($this->projectId);
- $this->assertCount(1, $members);
- $this->assertArrayHasKey($this->userId, $members);
- $this->assertEquals($this->username, $members[$this->userId]);
- }
-
- public function assertGetAssignableUsers()
- {
- $members = $this->app->getAssignableUsers($this->projectId);
- $this->assertCount(1, $members);
- $this->assertArrayHasKey($this->userId, $members);
- $this->assertEquals($this->username, $members[$this->userId]);
- }
-
- public function assertChangeProjectUserRole()
- {
- $this->assertTrue($this->app->changeProjectUserRole($this->projectId, $this->userId, 'project-viewer'));
-
- $members = $this->app->getAssignableUsers($this->projectId);
- $this->assertCount(0, $members);
- }
-
- public function assertRemoveProjectUser()
- {
- $this->assertTrue($this->app->removeProjectUser($this->projectId, $this->userId));
-
- $members = $this->app->getProjectUsers($this->projectId);
- $this->assertCount(0, $members);
- }
-
- public function assertAddProjectGroup()
- {
- $this->assertTrue($this->app->addGroupMember($this->groupId1, $this->userId));
- $this->assertTrue($this->app->addProjectGroup($this->projectId, $this->groupId1));
- }
-
- public function assertChangeProjectGroupRole()
- {
- $this->assertTrue($this->app->changeProjectGroupRole($this->projectId, $this->groupId1, 'project-viewer'));
-
- $members = $this->app->getAssignableUsers($this->projectId);
- $this->assertCount(0, $members);
- }
-
- public function assertRemoveProjectGroup()
- {
- $this->assertTrue($this->app->removeProjectGroup($this->projectId, $this->groupId1));
-
- $members = $this->app->getProjectUsers($this->projectId);
- $this->assertCount(0, $members);
- }
-}