public function testRemoveUsers_ProjectOwner_NotRemovedFromProject()
 {
     $this->environ->clean();
     // setup project and users.  user1 is the project owner
     $project = $this->environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE);
     $projectId = $project->id->asString();
     $user1Id = $this->environ->createUser("user1name", "User1 Name", "*****@*****.**");
     $user2Id = $this->environ->createUser("user2name", "User2 Name", "*****@*****.**");
     $user1 = new UserModel($user1Id);
     $user2 = new UserModel($user2Id);
     $project->addUser($user1->id->asString(), ProjectRoles::CONTRIBUTOR);
     $project->addUser($user2->id->asString(), ProjectRoles::CONTRIBUTOR);
     $project->ownerRef = $user2Id;
     $project->write();
     $user1->addProject($project->id->asString());
     $user1->write();
     $user2->addProject($project->id->asString());
     $user2->write();
     // save data for rest of this test
     $this->save['projectId'] = $projectId;
     $this->save['user1Id'] = $user1Id;
     $this->save['user2Id'] = $user2Id;
     // remove users from project.  user1 still remains as project owner
     $userIds = array($user1->id->asString(), $user2->id->asString());
     $this->expectException();
     $this->environ->inhibitErrorDisplay();
     ProjectCommands::removeUsers($projectId, $userIds);
     // nothing runs in the current test function after an exception. IJH 2014-11
 }
예제 #2
0
 public function project_removeUsers($userIds)
 {
     return ProjectCommands::removeUsers($this->_projectId, $userIds);
 }