예제 #1
0
 public function testLazyLoadingBranches()
 {
     $expectedResponse = json_encode($this->loadJsonFixture('fixture_branches.json'));
     $this->mockSimpleRequest($this->httpClient, 'get', $expectedResponse, 'https://api.github.com/repos/octocat/Hello-World/branches');
     $repository = new Repository($this->httpClient);
     $repository->populate($this->loadJsonFixture('fixture_repository.json'));
     foreach ($repository->getBranches() as $branch) {
         $this->assertInstanceOf(Branch::CLASS_NAME, $branch);
     }
 }