Пример #1
0
 public function testUpdateCurrentUser()
 {
     $user = new CurrentUser();
     $response = $this->getMock(ResponseInterface::class);
     $this->mapper->expects($this->any())->method('fromCurrentUser')->with($user)->willReturn(['key' => 'value']);
     $this->http->expects($this->once())->method('put')->with('/v2/user', ['key' => 'value', 'foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->once())->method('toUser');
     $this->client->updateCurrentUser($user, ['foo' => 'bar']);
 }
 public function testUpdateCurrentUser()
 {
     $user = $this->client->getCurrentUser();
     $user->setName('John Doe' === $user->getName() ? 'Jane Doe' : 'John Doe');
     $this->client->updateCurrentUser($user);
 }