| @@ 61-74 (lines=14) @@ | ||
| 58 | /** |
|
| 59 | * Test list gists of current users |
|
| 60 | */ |
|
| 61 | public function testListGists() |
|
| 62 | { |
|
| 63 | $gists = $this->gists->listGists(); |
|
| 64 | if (!empty($gists)) { |
|
| 65 | $gist = array_pop($gists); |
|
| 66 | ||
| 67 | $this->assertArrayHasKey('url', $gist); |
|
| 68 | $this->assertArrayHasKey('files', $gist); |
|
| 69 | $this->assertArrayHasKey('comments', $gist); |
|
| 70 | $this->assertArrayHasKey('created_at', $gist); |
|
| 71 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 72 | $this->assertArrayHasKey('user', $gist); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Test list public gists |
|
| @@ 79-92 (lines=14) @@ | ||
| 76 | /** |
|
| 77 | * Test list public gists |
|
| 78 | */ |
|
| 79 | public function testPublicListGists() |
|
| 80 | { |
|
| 81 | $gists = $this->gists->listPublicGists(); |
|
| 82 | if (!empty($gists)) { |
|
| 83 | $gist = array_pop($gists); |
|
| 84 | ||
| 85 | $this->assertArrayHasKey('url', $gist); |
|
| 86 | $this->assertArrayHasKey('files', $gist); |
|
| 87 | $this->assertArrayHasKey('comments', $gist); |
|
| 88 | $this->assertArrayHasKey('created_at', $gist); |
|
| 89 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 90 | $this->assertArrayHasKey('user', $gist); |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Test list user's starred gists |
|
| @@ 97-110 (lines=14) @@ | ||
| 94 | /** |
|
| 95 | * Test list user's starred gists |
|
| 96 | */ |
|
| 97 | public function testListUsersStarredGists() |
|
| 98 | { |
|
| 99 | $gists = $this->gists->listUsersStarredGists(); |
|
| 100 | if (!empty($gists)) { |
|
| 101 | $gist = array_pop($gists); |
|
| 102 | ||
| 103 | $this->assertArrayHasKey('url', $gist); |
|
| 104 | $this->assertArrayHasKey('files', $gist); |
|
| 105 | $this->assertArrayHasKey('comments', $gist); |
|
| 106 | $this->assertArrayHasKey('created_at', $gist); |
|
| 107 | $this->assertArrayHasKey('updated_at', $gist); |
|
| 108 | $this->assertArrayHasKey('user', $gist); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * Test creating a new gist |
|
| @@ 179-189 (lines=11) @@ | ||
| 176 | * |
|
| 177 | * @param string $gistId |
|
| 178 | */ |
|
| 179 | public function testListGistsCommit(string $gistId) |
|
| 180 | { |
|
| 181 | $gists = $this->gists->listGistsCommits($gistId); |
|
| 182 | $gist = array_pop($gists); |
|
| 183 | ||
| 184 | $this->assertArrayHasKey('user', $gist); |
|
| 185 | $this->assertArrayHasKey('version', $gist); |
|
| 186 | $this->assertArrayHasKey('committed_at', $gist); |
|
| 187 | $this->assertArrayHasKey('change_status', $gist); |
|
| 188 | $this->assertArrayHasKey('url', $gist); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * Test starring a gist |
|