public function testUpdateAccount()
 {
     $account = $this->createAccount();
     $account->setName('foo');
     $this->client->updateAccount($account);
     $account->setName('bar');
     $this->client->refreshAccount($account);
     $this->assertEquals('foo', $account->getName());
 }
예제 #2
0
 public function testUpdateAccount()
 {
     $account = Account::reference('ACCOUNT_ID');
     $response = $this->getMock(ResponseInterface::class);
     $this->mapper->expects($this->any())->method('fromAccount')->with($account)->willReturn(['key' => 'value']);
     $this->http->expects($this->once())->method('put')->with('/v2/accounts/ACCOUNT_ID', ['key' => 'value', 'foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->once())->method('toAccount')->with($response, $account);
     $this->client->updateAccount($account, ['foo' => 'bar']);
 }