public function testLoadNextDeposits() { /** @var \PHPUnit_Framework_MockObject_MockObject|ResourceCollection $deposits */ $deposits = $this->getMock(ResourceCollection::class); $response = $this->getMock(ResponseInterface::class); $nextPage = new ResourceCollection(); $deposits->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('toDeposits')->willReturn($nextPage); $deposits->expects($this->once())->method('mergeNextPage')->with($nextPage); $this->client->loadNextDeposits($deposits, ['foo' => 'bar']); }