Esempio n. 1
0
 public function testLazyLoadingKeys()
 {
     $expectedResponse = json_encode($this->loadJsonFixture('fixture4.json'));
     $this->mockSimpleRequest($this->httpClient, 'get', $expectedResponse, 'https://api.github.com/repos/octocat/Hello-World/keys');
     $repository = new Repository($this->httpClient);
     $repository->populate($this->loadJsonFixture('fixture_repository.json'));
     foreach ($repository->getKeys() as $key) {
         $this->assertInstanceOf('MPScholten\\GitHubApi\\Api\\Repository\\Key', $key);
     }
     $this->assertEquals($repository->getKeys(), $repository->getDeployKeys(), 'getDeployKeys should return the same as getKeys');
 }