コード例 #1
0
 public function testRemoveGroupMember()
 {
     $restService = new camundaRestClient(self::$restApi);
     $user = array();
     $profile = array();
     $credentials = array();
     $profile['id'] = 'shentschel';
     $profile['firstName'] = 'Stefan';
     $profile['lastName'] = 'Hentschel';
     $profile['email'] = '*****@*****.**';
     $credentials['password'] = '******';
     $user['profile'] = $profile;
     $user['credentials'] = $credentials;
     $restService->createSingleUser($user);
     $groupRequest = array('name' => 'testgroup', 'id' => 'sales', 'type' => 'Organizational Unit');
     $restService->createSingleGroup($groupRequest);
     $groupRequest = array('name' => 'testgroup2', 'id' => 'sales2', 'type' => 'Organizational Unit');
     $restService->createSingleGroup($groupRequest);
     $restService->addGroupMember('sales', 'shentschel');
     $filteredGroup = array('member' => 'shentschel');
     $this->assertEquals(1, $restService->getGroupsCount($filteredGroup)->count);
     $restService->removeGroupMember('sales', 'shentschel');
     $this->assertEquals(0, $restService->getGroupsCount($filteredGroup)->count);
     $restService->deleteSingleGroup('sales');
     $restService->deleteSingleGroup('sales2');
     $restService->deleteSingleUser('shentschel');
 }
コード例 #2
0
 /**
  * @test
  */
 public function updateUserProfile()
 {
     $restService = new camundaRestClient(self::$restApi);
     $user = array();
     $profile['id'] = 'shentschel';
     $profile['firstName'] = 'Stefan';
     $profile['lastName'] = 'Hentschel';
     $profile['email'] = '*****@*****.**';
     $credentials['password'] = '******';
     $user['profile'] = $profile;
     $user['credentials'] = $credentials;
     $restService->createSingleUser($user);
     $this->assertEquals('Stefan', $restService->getUserProfile('shentschel')->firstName);
     unset($profile);
     $profile = array();
     $profile['id'] = 'shentschel';
     $profile['firstName'] = 'John';
     $profile['lastName'] = 'Doe';
     $profile['email'] = '*****@*****.**';
     $restService->updateUserProfile('shentschel', $profile);
     $this->assertEquals('John', $restService->getUserProfile('shentschel')->firstName);
     $restService->deleteSingleUser('shentschel');
 }