Пример #1
0
 function it_updates_user(Client $client, User $user)
 {
     $request = array('id' => '123456', 'name' => 'Test', 'title' => 'Tester', 'mention_name' => 'test', 'is_group_admin' => false, 'email' => '*****@*****.**');
     $user->toJson()->shouldBeCalled()->willReturn($request);
     $user->getId()->shouldBeCalled()->willReturn('123456');
     $client->put('/v2/user/123456', $request)->shouldBeCalled();
     $this->updateUser($user, 'test1234');
 }
Пример #2
0
 /**
  * Update a user
  * More info: https://www.hipchat.com/docs/apiv2/method/update_user
  *
  * @param User $user User to be updated
  *
  * @return void
  */
 public function updateUser(User $user)
 {
     $request = $user->toJson();
     $this->client->put(sprintf('/v2/user/%s', $user->getId()), $request);
 }