public function testRemoveGroupMember()
 {
     $user = new UserRequest();
     $userProfile = new ProfileRequest();
     $userCredentials = new CredentialsRequest();
     $userProfile->setId('shentschel')->setFirstName('Stefan')->setLastName('Hentschel')->setEmail('*****@*****.**');
     $userCredentials->setPassword('123456');
     $user->setProfile($userProfile)->setCredentials($userCredentials);
     self::$us->createUser($user);
     $groupRequest = new GroupRequest();
     $groupRequest->setName('testgroup')->setId('PHP_UNIT_TEST_1')->setType('Organizational Unit');
     self::$gs->createGroup($groupRequest);
     $groupRequest = new GroupRequest();
     $groupRequest->setName('testgroup2')->setId('PHP_UNIT_TEST_2')->setType('Organizational Unit');
     self::$gs->createGroup($groupRequest);
     self::$gs->addMember('PHP_UNIT_TEST_1', 'shentschel');
     $filteredGroup = new GroupRequest();
     $filteredGroup->setMember('shentschel');
     $this->assertEquals(1, self::$gs->getCount($filteredGroup));
     self::$gs->removeMember('PHP_UNIT_TEST_1', 'shentschel');
     $this->assertEquals(0, self::$gs->getCount($filteredGroup));
     self::$gs->deleteGroup('PHP_UNIT_TEST_1');
     self::$gs->deleteGroup('PHP_UNIT_TEST_2');
     self::$us->deleteUser('shentschel');
 }
 /**
  * @test
  */
 public function setAssignee()
 {
     $ur = new UserRequest();
     $up = new ProfileRequest();
     $uc = new CredentialsRequest();
     $up->setId('shentschel')->setFirstName('Stefan')->setLastName('Hentschel')->setEmail('*****@*****.**');
     $uc->setPassword('654321');
     $ur->setProfile($up)->setCredentials($uc);
     self::$us->createUser($ur);
     $task = self::$ts->getTasks(new TaskRequest())->task_1;
     $tr = new TaskRequest();
     $tr->setUserId('shentschel');
     self::$ts->setAssignee($task->getId(), $tr);
     $this->assertEquals('shentschel', self::$ts->getTask($task->getId())->getAssignee());
     $tr = new TaskRequest();
     $tr->setUserId('demo');
     self::$ts->setAssignee($task->getId(), $tr);
     self::$us->deleteUser($up->getId());
 }
 /**
  * @test
  */
 public function updateUserProfile()
 {
     $filteredUser = new UserRequest();
     $filteredUser->setFirstName('stefan');
     $user = new UserRequest();
     $userProfile = new ProfileRequest();
     $userCredentials = new CredentialsRequest();
     $userProfile->setId('shentschel')->setFirstName('stefan')->setLastName('hentschel')->setEmail('*****@*****.**');
     $userCredentials->setPassword('123456');
     $user->setProfile($userProfile)->setCredentials($userCredentials);
     self::$us->createUser($user);
     $this->assertEquals('stefan', self::$us->getProfile('shentschel')->getFirstName());
     $userProfile = new ProfileRequest();
     $userProfile->setId('shentschel')->setFirstName('John')->setLastName('Doe')->setEmail('*****@*****.**');
     self::$us->updateProfile('shentschel', $userProfile);
     $this->assertEquals('John', self::$us->getProfile('shentschel')->getFirstName());
     self::$us->deleteUser('shentschel');
 }