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);
 }
示例#2
0
 public function testLoadNextAddresses()
 {
     /** @var \PHPUnit_Framework_MockObject_MockObject|ResourceCollection $addresses */
     $addresses = $this->getMock(ResourceCollection::class);
     $response = $this->getMock(ResponseInterface::class);
     $nextPage = new ResourceCollection();
     $addresses->expects($this->any())->method('getNextUri')->willReturn('/test/next/uri');
     $this->http->expects($this->any())->method('get')->with('/test/next/uri', ['foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->any())->method('toAddresses')->willReturn($nextPage);
     $addresses->expects($this->once())->method('mergeNextPage')->with($nextPage);
     $this->client->loadNextAddresses($addresses, ['foo' => 'bar']);
 }