Example #1
0
 public function testCreateTransaction()
 {
     $account = Account::reference('ACCOUNT_ID');
     $transaction = new Transaction();
     $response = $this->getMock(ResponseInterface::class);
     $this->mapper->expects($this->any())->method('fromTransaction')->with($transaction)->willReturn(['key' => 'value']);
     $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/transactions', ['key' => 'value', 'foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->once())->method('toTransaction')->with($response, $transaction);
     $this->client->createAccountTransaction($account, $transaction, ['foo' => 'bar']);
 }