Skip to content

Commit 4f44bb3

Browse files
committed
added ::class in all tests
1 parent f79fb97 commit 4f44bb3

Some content is hidden

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

58 files changed

+301
-135
lines changed

test/Github/Tests/Api/AbstractApiTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function shouldPassGETRequestToClient()
2121
->method('get')
2222
->with('/path?param1=param1value', array('header1' => 'header1value'))
2323
->will($this->returnValue($this->getPSR7Response($expectedArray)));
24-
$client = $this->getMockBuilder('Github\Client')
24+
$client = $this->getMockBuilder(\Github\Client::class)
2525
->setMethods(array('getHttpClient'))
2626
->getMock();
2727
$client->expects($this->any())
@@ -49,7 +49,7 @@ public function shouldPassPOSTRequestToClient()
4949
->with('/path', array('option1' => 'option1value'), json_encode(array('param1' => 'param1value')))
5050
->will($this->returnValue($this->getPSR7Response($expectedArray)));
5151

52-
$client = $this->getMockBuilder('Github\Client')
52+
$client = $this->getMockBuilder(\Github\Client::class)
5353
->setMethods(array('getHttpClient'))
5454
->getMock();
5555
$client->expects($this->any())
@@ -76,7 +76,7 @@ public function shouldPassPATCHRequestToClient()
7676
->with('/path', array('option1' => 'option1value'), json_encode(array('param1' => 'param1value')))
7777
->will($this->returnValue($this->getPSR7Response($expectedArray)));
7878

79-
$client = $this->getMockBuilder('Github\Client')
79+
$client = $this->getMockBuilder(\Github\Client::class)
8080
->setMethods(array('getHttpClient'))
8181
->getMock();
8282
$client->expects($this->any())
@@ -158,7 +158,7 @@ public function shouldNotPassEmptyRefToClient()
158158
->with('/path', array())
159159
->will($this->returnValue($this->getPSR7Response($expectedArray)));
160160

161-
$client = $this->getMockBuilder('Github\Client')
161+
$client = $this->getMockBuilder(\Github\Client::class)
162162
->setMethods(array('getHttpClient'))
163163
->getMock();
164164
$client->expects($this->any())
@@ -213,7 +213,7 @@ protected function getClientMock()
213213
protected function getHttpMethodsMock(array $methods = array())
214214
{
215215
$methods = array_merge(array('sendRequest'), $methods);
216-
$mock = $this->getMockBuilder('Http\Client\Common\HttpMethodsClient')
216+
$mock = $this->getMockBuilder(\Http\Client\Common\HttpMethodsClient::class)
217217
->disableOriginalConstructor()
218218
->setMethods($methods)
219219
->getMock();
@@ -228,7 +228,7 @@ protected function getHttpMethodsMock(array $methods = array())
228228
*/
229229
protected function getHttpClientMock()
230230
{
231-
$mock = $this->getMockBuilder('Http\Client\HttpClient')
231+
$mock = $this->getMockBuilder(\Http\Client\HttpClient::class)
232232
->setMethods(array('sendRequest'))
233233
->getMock();
234234
$mock

test/Github/Tests/Api/AuthorizationsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ public function shouldRevokeAllAuthorizations()
151151
$api->revokeAll($id);
152152
}
153153

154+
/**
155+
* @return string
156+
*/
154157
protected function getApiClass()
155158
{
156-
return 'Github\Api\Authorizations';
159+
return \Github\Api\Authorizations::class;
157160
}
158161
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ public function shouldRemoveKey()
146146
$this->assertEquals($expectedValue, $api->remove(123));
147147
}
148148

149+
/**
150+
* @return string
151+
*/
149152
protected function getApiClass()
150153
{
151-
return 'Github\Api\CurrentUser\DeployKeys';
154+
return \Github\Api\CurrentUser\DeployKeys::class;
152155
}
153156
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ public function shouldNotAddEmailsWhenAreNotPass()
110110
$api->add(array());
111111
}
112112

113+
/**
114+
* @return string
115+
*/
113116
protected function getApiClass()
114117
{
115-
return 'Github\Api\CurrentUser\Emails';
118+
return \Github\Api\CurrentUser\Emails::class;
116119
}
117120
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ public function shouldUnfollowUser()
6565
$this->assertNull($api->unfollow('l3l0'));
6666
}
6767

68+
/**
69+
* @return string
70+
*/
6871
protected function getApiClass()
6972
{
70-
return 'Github\Api\CurrentUser\Followers';
73+
return \Github\Api\CurrentUser\Followers::class;
7174
}
7275
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ public function shouldEditMembershipsForOrganization()
8484
$this->assertEquals($expectedValue, $api->edit('invitocat'));
8585
}
8686

87+
/**
88+
* @return string
89+
*/
8790
protected function getApiClass()
8891
{
89-
return 'Github\Api\CurrentUser\Memberships';
92+
return \Github\Api\CurrentUser\Memberships::class;
9093
}
9194
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ public function shouldUnstarUser()
6565
$this->assertNull($api->unstar('l3l0', 'test'));
6666
}
6767

68+
/**
69+
* @return string
70+
*/
6871
protected function getApiClass()
6972
{
70-
return 'Github\Api\CurrentUser\Starring';
73+
return \Github\Api\CurrentUser\Starring::class;
7174
}
7275
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ public function shouldUnwatchUser()
6565
$this->assertNull($api->unwatch('l3l0', 'test'));
6666
}
6767

68+
/**
69+
* @return string
70+
*/
6871
protected function getApiClass()
6972
{
70-
return 'Github\Api\CurrentUser\Watchers';
73+
return \Github\Api\CurrentUser\Watchers::class;
7174
}
7275
}

test/Github/Tests/Api/CurrentUserTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function shouldGetDeployKeysApiObject()
9191
{
9292
$api = $this->getApiMock();
9393

94-
$this->assertInstanceOf('Github\Api\CurrentUser\DeployKeys', $api->keys());
94+
$this->assertInstanceOf(\Github\Api\CurrentUser\DeployKeys::class, $api->keys());
9595
}
9696

9797
/**
@@ -101,7 +101,7 @@ public function shouldGetEmailsApiObject()
101101
{
102102
$api = $this->getApiMock();
103103

104-
$this->assertInstanceOf('Github\Api\CurrentUser\Emails', $api->emails());
104+
$this->assertInstanceOf(\Github\Api\CurrentUser\Emails::class, $api->emails());
105105
}
106106

107107
/**
@@ -111,7 +111,7 @@ public function shouldGetFollowersApiObject()
111111
{
112112
$api = $this->getApiMock();
113113

114-
$this->assertInstanceOf('Github\Api\CurrentUser\Followers', $api->follow());
114+
$this->assertInstanceOf(\Github\Api\CurrentUser\Followers::class, $api->follow());
115115
}
116116

117117
/**
@@ -121,7 +121,7 @@ public function shouldGetNotificationsApiObject()
121121
{
122122
$api = $this->getApiMock();
123123

124-
$this->assertInstanceOf('Github\Api\CurrentUser\Notifications', $api->notifications());
124+
$this->assertInstanceOf(\Github\Api\CurrentUser\Notifications::class, $api->notifications());
125125
}
126126

127127
/**
@@ -131,7 +131,7 @@ public function shouldGetWatchersApiObject()
131131
{
132132
$api = $this->getApiMock();
133133

134-
$this->assertInstanceOf('Github\Api\CurrentUser\Watchers', $api->watchers());
134+
$this->assertInstanceOf(\Github\Api\CurrentUser\Watchers::class, $api->watchers());
135135
}
136136

137137
/**
@@ -141,11 +141,14 @@ public function shouldGetStarredApiObject()
141141
{
142142
$api = $this->getApiMock();
143143

144-
$this->assertInstanceOf('Github\Api\CurrentUser\Starring', $api->starring());
144+
$this->assertInstanceOf(\Github\Api\CurrentUser\Starring::class, $api->starring());
145145
}
146146

147+
/**
148+
* @return string
149+
*/
147150
protected function getApiClass()
148151
{
149-
return 'Github\Api\CurrentUser';
152+
return \Github\Api\CurrentUser::class;
150153
}
151154
}

test/Github/Tests/Api/DeploymentTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ public function shouldGetAllStatuses()
8686
$api->getStatuses('KnpLabs', 'php-github-api', 1);
8787
}
8888

89+
/**
90+
* @return string
91+
*/
8992
protected function getApiClass()
9093
{
91-
return 'Github\Api\Deployment';
94+
return \Github\Api\Deployment::class;
9295
}
9396
}

0 commit comments

Comments
 (0)