Esempio n. 1
0
 public function testGetAddresses()
 {
     $account = Account::reference('ACCOUNT_ID');
     $response = $this->getMock(ResponseInterface::class);
     $expected = new ResourceCollection();
     $this->http->expects($this->any())->method('get')->with('/v2/accounts/ACCOUNT_ID/addresses', ['foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->any())->method('toAddresses')->with($response)->willReturn($expected);
     $actual = $this->client->getAccountAddresses($account, ['foo' => 'bar']);
     $this->assertSame($expected, $actual);
 }
 public function testLoadNextAddresses()
 {
     $account = $this->createAccount();
     $this->client->createAccountAddress($account, new Address());
     sleep(1);
     $this->client->createAccountAddress($account, new Address());
     sleep(1);
     $addresses = $this->client->getAccountAddresses($account, ['limit' => 1]);
     $this->assertCount(1, $addresses);
     $this->client->loadNextAddresses($addresses, ['limit' => 1]);
     $this->assertCount(2, $addresses);
 }