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()); }
public function setToAccountId($accountId) { $this->to = Account::reference($accountId); }
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']); }