public function testLoadNextAccounts()
 {
     $this->createAccount();
     $this->createAccount();
     $accounts = $this->client->getAccounts(['limit' => 1]);
     $this->assertCount(1, $accounts);
     $this->client->loadNextAccounts($accounts, ['limit' => 1]);
     $this->assertCount(2, $accounts);
 }
Example #2
0
 public function testLoadNextAccounts()
 {
     /** @var \PHPUnit_Framework_MockObject_MockObject|ResourceCollection $accounts */
     $accounts = $this->getMock(ResourceCollection::class);
     $response = $this->getMock(ResponseInterface::class);
     $nextPage = new ResourceCollection();
     $accounts->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('toAccounts')->willReturn($nextPage);
     $accounts->expects($this->once())->method('mergeNextPage')->with($nextPage);
     $this->client->loadNextAccounts($accounts, ['foo' => 'bar']);
 }