Esempio n. 1
0
 public function testReference()
 {
     $account = Account::reference('ACCOUNT_ID');
     $this->assertEquals(ResourceType::ACCOUNT, $account->getResourceType());
     $this->assertEquals('/v2/accounts/ACCOUNT_ID', $account->getResourcePath());
     $this->assertEquals('ACCOUNT_ID', $account->getId());
 }
Esempio n. 2
0
 public function setToAccountId($accountId)
 {
     $this->to = Account::reference($accountId);
 }
Esempio n. 3
0
 public function testCreateWithdrawal()
 {
     $account = Account::reference('ACCOUNT_ID');
     $withdrawal = new Withdrawal();
     $response = $this->getMock(ResponseInterface::class);
     $this->mapper->expects($this->any())->method('fromWithdrawal')->with($withdrawal)->willReturn(['key' => 'value']);
     $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/withdrawals', ['key' => 'value', 'foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->once())->method('toWithdrawal')->with($response, $withdrawal);
     $this->client->createAccountWithdrawal($account, $withdrawal, ['foo' => 'bar']);
 }