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