| @@ 45-58 (lines=14) @@ | ||
| 42 | /** |
|
| 43 | * Test list gists of current users |
|
| 44 | */ |
|
| 45 | public function testListGists() |
|
| 46 | { |
|
| 47 | $gists = $this->gists->listGists(); |
|
| 48 | if (!empty($gists)) { |
|
| 49 | $gist = array_pop($gists); |
|
| 50 | ||
| 51 | $this->assertArrayHasKey('url', $gist); |
|
| 52 | $this->assertArrayHasKey('files', $gist); |
|
| 53 | $this->assertArrayHasKey('comments', $gist); |
|
| 54 | $this->assertArrayHasKey('created_at', $gist); |
|
| 55 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 56 | $this->assertArrayHasKey('user', $gist); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Test list public gists |
|
| @@ 63-76 (lines=14) @@ | ||
| 60 | /** |
|
| 61 | * Test list public gists |
|
| 62 | */ |
|
| 63 | public function testPublicListGists() |
|
| 64 | { |
|
| 65 | $gists = $this->gists->listPublicGists(); |
|
| 66 | if (!empty($gists)) { |
|
| 67 | $gist = array_pop($gists); |
|
| 68 | ||
| 69 | $this->assertArrayHasKey('url', $gist); |
|
| 70 | $this->assertArrayHasKey('files', $gist); |
|
| 71 | $this->assertArrayHasKey('comments', $gist); |
|
| 72 | $this->assertArrayHasKey('created_at', $gist); |
|
| 73 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 74 | $this->assertArrayHasKey('user', $gist); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * Test list user's starred gists |
|
| @@ 81-94 (lines=14) @@ | ||
| 78 | /** |
|
| 79 | * Test list user's starred gists |
|
| 80 | */ |
|
| 81 | public function testListUsersStarredGists() |
|
| 82 | { |
|
| 83 | $gists = $this->gists->listUsersStarredGists(); |
|
| 84 | if (!empty($gists)) { |
|
| 85 | $gist = array_pop($gists); |
|
| 86 | ||
| 87 | $this->assertArrayHasKey('url', $gist); |
|
| 88 | $this->assertArrayHasKey('files', $gist); |
|
| 89 | $this->assertArrayHasKey('comments', $gist); |
|
| 90 | $this->assertArrayHasKey('created_at', $gist); |
|
| 91 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 92 | $this->assertArrayHasKey('user', $gist); |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * Test creating a new gist |
|
| @@ 163-173 (lines=11) @@ | ||
| 160 | * |
|
| 161 | * @param string $gistId |
|
| 162 | */ |
|
| 163 | public function testListGistsCommit(string $gistId) |
|
| 164 | { |
|
| 165 | $gists = $this->gists->listGistsCommits($gistId); |
|
| 166 | $gist = array_pop($gists); |
|
| 167 | ||
| 168 | $this->assertArrayHasKey('user', $gist); |
|
| 169 | $this->assertArrayHasKey('version', $gist); |
|
| 170 | $this->assertArrayHasKey('committed_at', $gist); |
|
| 171 | $this->assertArrayHasKey('change_status', $gist); |
|
| 172 | $this->assertArrayHasKey('url', $gist); |
|
| 173 | } |
|
| 174 | ||
| 175 | /** |
|
| 176 | * Test starring a gist |
|