public function testGetAccounts() { $response = $this->getMock(ResponseInterface::class); $expected = new ResourceCollection(); $this->http->expects($this->any())->method('get')->with('/v2/accounts', ['foo' => 'bar'])->willReturn($response); $this->mapper->expects($this->any())->method('toAccounts')->with($response)->willReturn($expected); $actual = $this->client->getAccounts(['foo' => 'bar']); $this->assertSame($expected, $actual); }
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); }