Skip to content

Commit 2e2139d

Browse files
committed
Upgrade to PHPUnit 8
1 parent 93d219c commit 2e2139d

59 files changed

Lines changed: 298 additions & 288 deletions

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ vendor/
22
composer.phar
33
composer.lock
44
phpunit.xml
5+
.phpunit.result.cache
56

67
# Build files
78
/build/coverage

Tests/GithubObjectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GithubObjectTest extends GitHubTestCase
3030
*
3131
* @since 1.0
3232
*/
33-
protected function setUp()
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

Tests/GithubTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GithubTest extends GitHubTestCase
3030
*
3131
* @since 1.0
3232
*/
33-
protected function setUp()
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

@@ -102,11 +102,12 @@ public function testGetHooks()
102102
*
103103
* @return void
104104
*
105-
* @since 1.0
106-
* @expectedException \InvalidArgumentException
105+
* @since 1.0
107106
*/
108107
public function testGetFailure()
109108
{
109+
$this->expectException(\InvalidArgumentException::class);
110+
110111
$this->object->other;
111112
}
112113

Tests/Package/Activity/EventsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class EventsTest extends GitHubTestCase
4242
*
4343
* @return void
4444
*/
45-
protected function setUp()
45+
protected function setUp(): void
4646
{
4747
parent::setUp();
4848

Tests/Package/Activity/FeedsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FeedsTest extends GitHubTestCase
3030
*
3131
* @return void
3232
*/
33-
protected function setUp()
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

Tests/Package/Activity/NotificationsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class NotificationsTest extends GitHubTestCase
3232
*
3333
* @return void
3434
*/
35-
protected function setUp()
35+
protected function setUp(): void
3636
{
3737
parent::setUp();
3838

Tests/Package/Activity/StarringTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class StarringTest extends GitHubTestCase
3232
*
3333
* @return void
3434
*/
35-
protected function setUp()
35+
protected function setUp(): void
3636
{
3737
parent::setUp();
3838

@@ -107,11 +107,11 @@ public function testGetRepositoriesWithName()
107107
* Invalid sort option
108108
*
109109
* @return void
110-
*
111-
* @expectedException \InvalidArgumentException
112110
*/
113111
public function testGetRepositoriesInvalidSort()
114112
{
113+
$this->expectException(\InvalidArgumentException::class);
114+
115115
$this->object->getRepositories('', 'invalid');
116116
}
117117

@@ -123,11 +123,11 @@ public function testGetRepositoriesInvalidSort()
123123
* Invalid direction option
124124
*
125125
* @return void
126-
*
127-
* @expectedException \InvalidArgumentException
128126
*/
129127
public function testGetRepositoriesInvalidDirection()
130128
{
129+
$this->expectException(\InvalidArgumentException::class);
130+
131131
$this->object->getRepositories('', 'created', 'invalid');
132132
}
133133

@@ -182,11 +182,12 @@ public function testCheckFalse()
182182
*
183183
* @covers \Joomla\Github\Package\Activity\Starring::check()
184184
*
185-
* @expectedException \UnexpectedValueException
186185
* @return void
187186
*/
188187
public function testCheckUnexpected()
189188
{
189+
$this->expectException(\UnexpectedValueException::class);
190+
190191
$this->response->code = 666;
191192
$this->response->body = false;
192193

Tests/Package/Activity/WatchingTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class WatchingTest extends GitHubTestCase
3030
*
3131
* @return void
3232
*/
33-
protected function setUp()
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

@@ -193,11 +193,12 @@ public function testCheckFalse()
193193
/**
194194
* Tests the checkUnexpected method
195195
*
196-
* @expectedException \UnexpectedValueException
197196
* @return void
198197
*/
199198
public function testCheckUnexpected()
200199
{
200+
$this->expectException(\UnexpectedValueException::class);
201+
201202
$this->response->code = 666;
202203
$this->response->body = '';
203204

Tests/Package/ActivityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ActivityTest extends GitHubTestCase
3131
*
3232
* @return void
3333
*/
34-
protected function setUp()
34+
protected function setUp(): void
3535
{
3636
parent::setUp();
3737

Tests/Package/AuthorizationsTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AuthorizationsTest extends GitHubTestCase
2929
*
3030
* @since 1.0
3131
*/
32-
protected function setUp()
32+
protected function setUp(): void
3333
{
3434
parent::setUp();
3535

@@ -348,11 +348,11 @@ public function testEditFailure()
348348
* @return void
349349
*
350350
* @since 1.0
351-
*
352-
* @expectedException \RuntimeException
353351
*/
354352
public function testEditTooManyScopes()
355353
{
354+
$this->expectException(\RuntimeException::class);
355+
356356
$this->object->edit(42, array(), array('public_repo', 'gist'), array('public_repo', 'gist'), 'My test app', 'http://www.joomla.org');
357357
}
358358

@@ -382,11 +382,11 @@ public function testGet()
382382
* @return void
383383
*
384384
* @since 1.0
385-
*
386-
* @expectedException \DomainException
387385
*/
388386
public function testGetFailure()
389387
{
388+
$this->expectException(\DomainException::class);
389+
390390
$this->response->code = 500;
391391
$this->response->body = $this->errorString;
392392

@@ -424,11 +424,11 @@ public function testGetGrant()
424424
* @return void
425425
*
426426
* @since 1.0
427-
*
428-
* @expectedException \DomainException
429427
*/
430428
public function testGetGrantFailure()
431429
{
430+
$this->expectException(\DomainException::class);
431+
432432
$this->response->code = 500;
433433
$this->response->body = $this->errorString;
434434

@@ -466,11 +466,11 @@ public function testGetList()
466466
* @return void
467467
*
468468
* @since 1.0
469-
*
470-
* @expectedException \DomainException
471469
*/
472470
public function testGetListFailure()
473471
{
472+
$this->expectException(\DomainException::class);
473+
474474
$this->response->code = 500;
475475
$this->response->body = $this->errorString;
476476

@@ -508,11 +508,11 @@ public function testGetListGrants()
508508
* @return void
509509
*
510510
* @since 1.0
511-
*
512-
* @expectedException \DomainException
513511
*/
514512
public function testGetListGrantsFailure()
515513
{
514+
$this->expectException(\DomainException::class);
515+
516516
$this->response->code = 500;
517517
$this->response->body = $this->errorString;
518518

@@ -570,11 +570,11 @@ public function testGetRateLimitUnlimited()
570570
* @return void
571571
*
572572
* @since 1.0
573-
*
574-
* @expectedException \DomainException
575573
*/
576574
public function testGetRateLimitFailure()
577575
{
576+
$this->expectException(\DomainException::class);
577+
578578
$this->response->code = 500;
579579
$this->response->body = $this->errorString;
580580

@@ -670,11 +670,11 @@ public function testRequestTokenXml()
670670
* Tests the requestTokenInvalidFormat method
671671
*
672672
* @return void
673-
*
674-
* @expectedException \UnexpectedValueException
675673
*/
676674
public function testRequestTokenInvalidFormat()
677675
{
676+
$this->expectException(\UnexpectedValueException::class);
677+
678678
$this->response->code = 200;
679679
$this->response->body = '';
680680

@@ -709,11 +709,11 @@ public function testRevokeGrantForApplication()
709709
* @return void
710710
*
711711
* @since 1.0
712-
*
713-
* @expectedException \DomainException
714712
*/
715713
public function testRevokeGrantForApplicationFailure()
716714
{
715+
$this->expectException(\DomainException::class);
716+
717717
$this->response->code = 500;
718718
$this->response->body = $this->errorString;
719719

0 commit comments

Comments
 (0)