Repository navigation
Expand file tree
/
Copy pathRepoTest.php
More file actions
51 lines (44 loc) · 1.65 KB
/
Copy pathRepoTest.php
File metadata and controls
51 lines (44 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace Github\Tests\Functional;
class RepoTest extends TestCase
{
/**
* @test
*/
public function shouldRetrieveContributorsList()
{
$username = 'KnpLabs';
$repo = 'php-github-api';
$contributors = $this->client->api('repo')->contributors($username, $repo);
$contributor = array_pop($contributors);
$this->assertArrayHasKey('url', $contributor);
$this->assertArrayHasKey('gravatar_id', $contributor);
$this->assertArrayHasKey('contributions', $contributor);
$this->assertArrayHasKey('avatar_url', $contributor);
$this->assertArrayHasKey('login', $contributor);
$this->assertArrayHasKey('id', $contributor);
}
/**
* @test
*/
public function shouldShowRepo()
{
$username = 'KnpLabs';
$repo = 'php-github-api';
$repo = $this->client->api('repo')->show($username, $repo);
$this->assertArrayHasKey('id', $repo);
$this->assertArrayHasKey('name', $repo);
$this->assertArrayHasKey('description', $repo);
$this->assertArrayHasKey('url', $repo);
$this->assertArrayHasKey('has_wiki', $repo);
$this->assertArrayHasKey('has_issues', $repo);
$this->assertArrayHasKey('forks', $repo);
$this->assertArrayHasKey('updated_at', $repo);
$this->assertArrayHasKey('created_at', $repo);
$this->assertArrayHasKey('pushed_at', $repo);
$this->assertArrayHasKey('open_issues', $repo);
$this->assertArrayHasKey('ssh_url', $repo);
$this->assertArrayHasKey('git_url', $repo);
$this->assertArrayHasKey('svn_url', $repo);
}
}