public function testLazyLoadingCollaborators() { $expectedResponse = json_encode($this->loadJsonFixture('fixture3.json')); $this->mockSimpleRequest($this->httpClient, 'get', $expectedResponse, 'https://api.github.com/repos/octocat/Hello-World/collaborators'); $repository = new Repository($this->httpClient); $repository->populate($this->loadJsonFixture('fixture_repository.json')); foreach ($repository->getCollaborators() as $collaborator) { $this->assertInstanceOf('MPScholten\\GitHubApi\\Api\\User\\User', $collaborator); } }