Skip to content

Commit 341f457

Browse files
committed
Fixed the tests
1 parent 51cd04c commit 341f457

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+300
-300
lines changed

lib/Github/Api/GitData/Blobs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function configure($bodyType = null)
3838
*/
3939
public function show($username, $repository, $sha)
4040
{
41-
$response = $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs/'.rawurlencode($sha));
41+
$response = $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs/'.rawurlencode($sha));
4242

4343
return $response;
4444
}
@@ -60,6 +60,6 @@ public function create($username, $repository, array $params)
6060
throw new MissingArgumentException(array('content', 'encoding'));
6161
}
6262

63-
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs', $params);
63+
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs', $params);
6464
}
6565
}

lib/Github/Api/Issue/Comments.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function configure($bodyType = null)
4343
*/
4444
public function all($username, $repository, $issue, $page = 1)
4545
{
46-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', array(
46+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', array(
4747
'page' => $page
4848
));
4949
}
@@ -60,7 +60,7 @@ public function all($username, $repository, $issue, $page = 1)
6060
*/
6161
public function show($username, $repository, $comment)
6262
{
63-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment));
63+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment));
6464
}
6565

6666
/**
@@ -81,7 +81,7 @@ public function create($username, $repository, $issue, array $params)
8181
throw new MissingArgumentException('body');
8282
}
8383

84-
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', $params);
84+
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', $params);
8585
}
8686

8787
/**
@@ -102,7 +102,7 @@ public function update($username, $repository, $comment, array $params)
102102
throw new MissingArgumentException('body');
103103
}
104104

105-
return $this->patch('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment), $params);
105+
return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment), $params);
106106
}
107107

108108
/**
@@ -117,6 +117,6 @@ public function update($username, $repository, $comment, array $params)
117117
*/
118118
public function remove($username, $repository, $comment)
119119
{
120-
return $this->delete('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment));
120+
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment));
121121
}
122122
}

lib/Github/Api/Repository/Comments.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public function configure($bodyType = null)
4040
public function all($username, $repository, $sha = null)
4141
{
4242
if (null === $sha) {
43-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments');
43+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments');
4444
}
4545

46-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments');
46+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments');
4747
}
4848

4949
public function show($username, $repository, $comment)
5050
{
51-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment));
51+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment));
5252
}
5353

5454
public function create($username, $repository, $sha, array $params)
@@ -57,7 +57,7 @@ public function create($username, $repository, $sha, array $params)
5757
throw new MissingArgumentException('body');
5858
}
5959

60-
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments', $params);
60+
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments', $params);
6161
}
6262

6363
public function update($username, $repository, $comment, array $params)
@@ -66,11 +66,11 @@ public function update($username, $repository, $comment, array $params)
6666
throw new MissingArgumentException('body');
6767
}
6868

69-
return $this->patch('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment), $params);
69+
return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment), $params);
7070
}
7171

7272
public function remove($username, $repository, $comment)
7373
{
74-
return $this->delete('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment));
74+
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment));
7575
}
7676
}

lib/Github/Api/Repository/Stargazers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function configure($bodyType = null)
3030

3131
public function all($username, $repository)
3232
{
33-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stargazers');
33+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stargazers');
3434
}
3535
}

test/Github/Tests/Api/AuthorizationsTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function shouldGetAllAuthorizations()
1414
$api = $this->getApiMock();
1515
$api->expects($this->once())
1616
->method('get')
17-
->with('authorizations')
17+
->with('/authorizations')
1818
->will($this->returnValue($expectedArray));
1919

2020
$this->assertEquals($expectedArray, $api->all());
@@ -31,7 +31,7 @@ public function shouldShowAuthorization()
3131
$api = $this->getApiMock();
3232
$api->expects($this->once())
3333
->method('get')
34-
->with('authorizations/'.$id)
34+
->with('/authorizations/'.$id)
3535
->will($this->returnValue($expectedArray));
3636

3737
$this->assertEquals($expectedArray, $api->show($id));
@@ -49,7 +49,7 @@ public function shouldAuthorization()
4949
$api = $this->getApiMock();
5050
$api->expects($this->once())
5151
->method('post')
52-
->with('authorizations', $input);
52+
->with('/authorizations', $input);
5353

5454
$api->create($input);
5555
}
@@ -67,7 +67,7 @@ public function shouldUpdateAuthorization()
6767
$api = $this->getApiMock();
6868
$api->expects($this->once())
6969
->method('patch')
70-
->with('authorizations/'.$id, $input);
70+
->with('/authorizations/'.$id, $input);
7171

7272
$api->update($id, $input);
7373
}
@@ -81,7 +81,7 @@ public function shouldDeleteAuthorization()
8181
$api = $this->getApiMock();
8282
$api->expects($this->once())
8383
->method('delete')
84-
->with('authorizations/'.$id);
84+
->with('/authorizations/'.$id);
8585

8686
$api->remove($id);
8787
}
@@ -98,7 +98,7 @@ public function shouldCheckAuthorization()
9898
$api = $this->getApiMock();
9999
$api->expects($this->once())
100100
->method('get')
101-
->with('applications/'.$id.'/tokens/'.$token)
101+
->with('/applications/'.$id.'/tokens/'.$token)
102102
->will($this->returnValue($expectedArray));
103103

104104
$this->assertEquals($expectedArray, $api->check($id, $token));
@@ -115,7 +115,7 @@ public function shouldResetAuthorization()
115115
$api = $this->getApiMock();
116116
$api->expects($this->once())
117117
->method('post')
118-
->with('applications/'.$id.'/tokens/'.$token);
118+
->with('/applications/'.$id.'/tokens/'.$token);
119119

120120
$api->reset($id, $token);
121121
}
@@ -131,7 +131,7 @@ public function shouldRevokeAuthorization()
131131
$api = $this->getApiMock();
132132
$api->expects($this->once())
133133
->method('delete')
134-
->with('applications/'.$id.'/tokens/'.$token);
134+
->with('/applications/'.$id.'/tokens/'.$token);
135135

136136
$api->revoke($id, $token);
137137
}
@@ -146,7 +146,7 @@ public function shouldRevokeAllAuthorizations()
146146
$api = $this->getApiMock();
147147
$api->expects($this->once())
148148
->method('delete')
149-
->with('applications/'.$id.'/tokens');
149+
->with('/applications/'.$id.'/tokens');
150150

151151
$api->revokeAll($id);
152152
}

test/Github/Tests/Api/CurrentUser/DeployKeysTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function shouldShowKey()
1414
$api = $this->getApiMock();
1515
$api->expects($this->once())
1616
->method('get')
17-
->with('user/keys/12')
17+
->with('/user/keys/12')
1818
->will($this->returnValue($expectedValue));
1919

2020
$this->assertEquals($expectedValue, $api->show(12));
@@ -30,7 +30,7 @@ public function shouldGetKeys()
3030
$api = $this->getApiMock();
3131
$api->expects($this->once())
3232
->method('get')
33-
->with('user/keys')
33+
->with('/user/keys')
3434
->will($this->returnValue($expectedValue));
3535

3636
$this->assertEquals($expectedValue, $api->all());
@@ -47,7 +47,7 @@ public function shouldCreateKey()
4747
$api = $this->getApiMock();
4848
$api->expects($this->once())
4949
->method('post')
50-
->with('user/keys', $data)
50+
->with('/user/keys', $data)
5151
->will($this->returnValue($expectedValue));
5252

5353
$this->assertEquals($expectedValue, $api->create($data));
@@ -94,7 +94,7 @@ public function shouldUpdateKey()
9494
$api = $this->getApiMock();
9595
$api->expects($this->once())
9696
->method('patch')
97-
->with('user/keys/123', $data)
97+
->with('/user/keys/123', $data)
9898
->will($this->returnValue($expectedValue));
9999

100100
$this->assertEquals($expectedValue, $api->update(123, $data));
@@ -140,7 +140,7 @@ public function shouldRemoveKey()
140140
$api = $this->getApiMock();
141141
$api->expects($this->once())
142142
->method('delete')
143-
->with('user/keys/123')
143+
->with('/user/keys/123')
144144
->will($this->returnValue($expectedValue));
145145

146146
$this->assertEquals($expectedValue, $api->remove(123));

test/Github/Tests/Api/CurrentUser/EmailsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function shouldGetEmails()
1414
$api = $this->getApiMock();
1515
$api->expects($this->once())
1616
->method('get')
17-
->with('user/emails')
17+
->with('/user/emails')
1818
->will($this->returnValue($expectedValue));
1919

2020
$this->assertEquals($expectedValue, $api->all());
@@ -30,7 +30,7 @@ public function shouldRemoveEmail()
3030
$api = $this->getApiMock();
3131
$api->expects($this->once())
3232
->method('delete')
33-
->with('user/emails', array('email@example.com'))
33+
->with('/user/emails', array('email@example.com'))
3434
->will($this->returnValue($expectedValue));
3535

3636
$this->assertEquals($expectedValue, $api->remove('email@example.com'));
@@ -46,7 +46,7 @@ public function shouldRemoveEmails()
4646
$api = $this->getApiMock();
4747
$api->expects($this->once())
4848
->method('delete')
49-
->with('user/emails', array('email@example.com', 'email2@example.com'))
49+
->with('/user/emails', array('email@example.com', 'email2@example.com'))
5050
->will($this->returnValue($expectedValue));
5151

5252
$this->assertEquals($expectedValue, $api->remove(array('email@example.com', 'email2@example.com')));
@@ -75,7 +75,7 @@ public function shouldAddEmail()
7575
$api = $this->getApiMock();
7676
$api->expects($this->once())
7777
->method('post')
78-
->with('user/emails', array('email@example.com'))
78+
->with('/user/emails', array('email@example.com'))
7979
->will($this->returnValue($expectedValue));
8080

8181
$this->assertEquals($expectedValue, $api->add('email@example.com'));
@@ -91,7 +91,7 @@ public function shouldAddEmails()
9191
$api = $this->getApiMock();
9292
$api->expects($this->once())
9393
->method('post')
94-
->with('user/emails', array('email@example.com', 'email2@example.com'))
94+
->with('/user/emails', array('email@example.com', 'email2@example.com'))
9595
->will($this->returnValue($expectedValue));
9696

9797
$this->assertEquals($expectedValue, $api->add(array('email@example.com', 'email2@example.com')));

test/Github/Tests/Api/CurrentUser/FollowersTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function shouldGetFollowers()
1717
$api = $this->getApiMock();
1818
$api->expects($this->once())
1919
->method('get')
20-
->with('user/following')
20+
->with('/user/following')
2121
->will($this->returnValue($expectedValue));
2222

2323
$this->assertEquals($expectedValue, $api->all());
@@ -31,7 +31,7 @@ public function shouldCheckFollower()
3131
$api = $this->getApiMock();
3232
$api->expects($this->once())
3333
->method('get')
34-
->with('user/following/l3l0')
34+
->with('/user/following/l3l0')
3535
->will($this->returnValue(null));
3636

3737
$this->assertNull($api->check('l3l0'));
@@ -45,7 +45,7 @@ public function shouldFollowUser()
4545
$api = $this->getApiMock();
4646
$api->expects($this->once())
4747
->method('put')
48-
->with('user/following/l3l0')
48+
->with('/user/following/l3l0')
4949
->will($this->returnValue(null));
5050

5151
$this->assertNull($api->follow('l3l0'));
@@ -59,7 +59,7 @@ public function shouldUnfollowUser()
5959
$api = $this->getApiMock();
6060
$api->expects($this->once())
6161
->method('delete')
62-
->with('user/following/l3l0')
62+
->with('/user/following/l3l0')
6363
->will($this->returnValue(null));
6464

6565
$this->assertNull($api->unfollow('l3l0'));

test/Github/Tests/Api/CurrentUser/MembershipsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function shouldGetMemberships()
3535
$api = $this->getApiMock();
3636
$api->expects($this->once())
3737
->method('get')
38-
->with('user/memberships/orgs')
38+
->with('/user/memberships/orgs')
3939
->will($this->returnValue($expectedValue));
4040

4141
$this->assertEquals($expectedValue, $api->all());
@@ -60,7 +60,7 @@ public function shouldGetMembershipsForOrganization()
6060
$api = $this->getApiMock();
6161
$api->expects($this->once())
6262
->method('get')
63-
->with('user/memberships/orgs/invitocat')
63+
->with('/user/memberships/orgs/invitocat')
6464
->will($this->returnValue($expectedValue));
6565

6666
$this->assertEquals($expectedValue, $api->organization('invitocat'));
@@ -78,7 +78,7 @@ public function shouldEditMembershipsForOrganization()
7878
$api = $this->getApiMock();
7979
$api->expects($this->once())
8080
->method('patch')
81-
->with('user/memberships/orgs/invitocat')
81+
->with('/user/memberships/orgs/invitocat')
8282
->will($this->returnValue($expectedValue));
8383

8484
$this->assertEquals($expectedValue, $api->edit('invitocat'));

test/Github/Tests/Api/CurrentUser/StarringTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function shouldGetStarred()
1717
$api = $this->getApiMock();
1818
$api->expects($this->once())
1919
->method('get')
20-
->with('user/starred')
20+
->with('/user/starred')
2121
->will($this->returnValue($expectedValue));
2222

2323
$this->assertEquals($expectedValue, $api->all());
@@ -31,7 +31,7 @@ public function shouldCheckStar()
3131
$api = $this->getApiMock();
3232
$api->expects($this->once())
3333
->method('get')
34-
->with('user/starred/l3l0/test')
34+
->with('/user/starred/l3l0/test')
3535
->will($this->returnValue(null));
3636

3737
$this->assertNull($api->check('l3l0', 'test'));
@@ -45,7 +45,7 @@ public function shouldStarUser()
4545
$api = $this->getApiMock();
4646
$api->expects($this->once())
4747
->method('put')
48-
->with('user/starred/l3l0/test')
48+
->with('/user/starred/l3l0/test')
4949
->will($this->returnValue(null));
5050

5151
$this->assertNull($api->star('l3l0', 'test'));
@@ -59,7 +59,7 @@ public function shouldUnstarUser()
5959
$api = $this->getApiMock();
6060
$api->expects($this->once())
6161
->method('delete')
62-
->with('user/starred/l3l0/test')
62+
->with('/user/starred/l3l0/test')
6363
->will($this->returnValue(null));
6464

6565
$this->assertNull($api->unstar('l3l0', 'test'));

0 commit comments

Comments
 (0)