| @@ 38-51 (lines=14) @@ | ||
| 35 | /** |
|
| 36 | * Test list gists of current users |
|
| 37 | */ |
|
| 38 | public function testListGists() |
|
| 39 | { |
|
| 40 | $gists = $this->gists->listGists(); |
|
| 41 | if (!empty($gists)) { |
|
| 42 | $gist = array_pop($gists); |
|
| 43 | ||
| 44 | $this->assertArrayHasKey('url', $gist); |
|
| 45 | $this->assertArrayHasKey('files', $gist); |
|
| 46 | $this->assertArrayHasKey('comments', $gist); |
|
| 47 | $this->assertArrayHasKey('created_at', $gist); |
|
| 48 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 49 | $this->assertArrayHasKey('user', $gist); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Test list public gists |
|
| @@ 56-69 (lines=14) @@ | ||
| 53 | /** |
|
| 54 | * Test list public gists |
|
| 55 | */ |
|
| 56 | public function testPublicListGists() |
|
| 57 | { |
|
| 58 | $gists = $this->gists->listPublicGists(); |
|
| 59 | if (!empty($gists)) { |
|
| 60 | $gist = array_pop($gists); |
|
| 61 | ||
| 62 | $this->assertArrayHasKey('url', $gist); |
|
| 63 | $this->assertArrayHasKey('files', $gist); |
|
| 64 | $this->assertArrayHasKey('comments', $gist); |
|
| 65 | $this->assertArrayHasKey('created_at', $gist); |
|
| 66 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 67 | $this->assertArrayHasKey('user', $gist); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * Test list user's starred gists |
|
| @@ 74-87 (lines=14) @@ | ||
| 71 | /** |
|
| 72 | * Test list user's starred gists |
|
| 73 | */ |
|
| 74 | public function testListUsersStarredGists() |
|
| 75 | { |
|
| 76 | $gists = $this->gists->listUsersStarredGists(); |
|
| 77 | if (!empty($gists)) { |
|
| 78 | $gist = array_pop($gists); |
|
| 79 | ||
| 80 | $this->assertArrayHasKey('url', $gist); |
|
| 81 | $this->assertArrayHasKey('files', $gist); |
|
| 82 | $this->assertArrayHasKey('comments', $gist); |
|
| 83 | $this->assertArrayHasKey('created_at', $gist); |
|
| 84 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 85 | $this->assertArrayHasKey('user', $gist); |
|
| 86 | } |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Test getting gist by ID |
|
| @@ 152-162 (lines=11) @@ | ||
| 149 | * |
|
| 150 | * @param string $gistId |
|
| 151 | */ |
|
| 152 | public function testListGistsCommit(string $gistId) |
|
| 153 | { |
|
| 154 | $gists = $this->gists->listGistsCommits($gistId); |
|
| 155 | $gist = array_pop($gists); |
|
| 156 | ||
| 157 | $this->assertArrayHasKey('user', $gist); |
|
| 158 | $this->assertArrayHasKey('version', $gist); |
|
| 159 | $this->assertArrayHasKey('committed_at', $gist); |
|
| 160 | $this->assertArrayHasKey('change_status', $gist); |
|
| 161 | $this->assertArrayHasKey('url', $gist); |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * Test starring a gist |
|