Skip to content

Commit 3b0f0c9

Browse files
authored
Merge pull request #805 from acrobat/bump-phpunit
Bump phpunit to supported version
2 parents d876019 + 0077a9f commit 3b0f0c9

Some content is hidden

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

50 files changed

+179
-115
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.php_cs.cache
22
phpunit.xml
3+
.phpunit.result.cache
34
composer.lock
45
composer.phar
56
vendor/*

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"php-http/cache-plugin": "^1.4"
2828
},
2929
"require-dev": {
30-
"phpunit/phpunit": "^6.0",
30+
"phpunit/phpunit": "^7.0 || ^8.0",
3131
"php-http/guzzle6-adapter": "^1.0",
3232
"php-http/mock-client": "^1.0",
3333
"guzzlehttp/psr7": "^1.2",

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="vendor/autoload.php"
1312
>
1413
<testsuites>

test/Github/Tests/Api/AbstractApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ public function shouldNotPassEmptyRefToClient()
171171
$api = $this->getAbstractApiObject($client);
172172
$actual = $this->getMethod($api, 'get')->invokeArgs($api, ['/path', ['ref' => null]]);
173173

174-
$this->assertInternalType('array', $actual);
174+
$this->assertIsArray($actual);
175175
}
176176

177177
/**
178178
* @param $client
179179
*
180-
* @return \PHPUnit_Framework_MockObject_MockObject
180+
* @return \PHPUnit\Framework\MockObject\MockObject
181181
*/
182182
protected function getAbstractApiObject($client)
183183
{

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Exception\MissingArgumentException;
6+
use Github\Tests\Api\TestCase;
47

58
class DeployKeysTest extends TestCase
69
{
@@ -55,10 +58,10 @@ public function shouldCreateKey()
5558

5659
/**
5760
* @test
58-
* @expectedException \Github\Exception\MissingArgumentException
5961
*/
6062
public function shouldNotCreateKeyWithoutTitleParam()
6163
{
64+
$this->expectException(MissingArgumentException::class);
6265
$data = ['key' => 'ssh-rsa ...'];
6366

6467
$api = $this->getApiMock();
@@ -70,10 +73,10 @@ public function shouldNotCreateKeyWithoutTitleParam()
7073

7174
/**
7275
* @test
73-
* @expectedException \Github\Exception\MissingArgumentException
7476
*/
7577
public function shouldNotCreateKeyWithoutKeyParam()
7678
{
79+
$this->expectException(MissingArgumentException::class);
7780
$data = ['title' => 'my key'];
7881

7982
$api = $this->getApiMock();

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Exception\InvalidArgumentException;
6+
use Github\Tests\Api\TestCase;
47

58
class EmailsTest extends TestCase
69
{
@@ -54,10 +57,10 @@ public function shouldRemoveEmails()
5457

5558
/**
5659
* @test
57-
* @expectedException \Github\Exception\InvalidArgumentException
5860
*/
5961
public function shouldNotRemoveEmailsWhenAreNotPass()
6062
{
63+
$this->expectException(InvalidArgumentException::class);
6164
$api = $this->getApiMock();
6265
$api->expects($this->any())
6366
->method('delete');
@@ -99,10 +102,10 @@ public function shouldAddEmails()
99102

100103
/**
101104
* @test
102-
* @expectedException \Github\Exception\InvalidArgumentException
103105
*/
104106
public function shouldNotAddEmailsWhenAreNotPass()
105107
{
108+
$this->expectException(InvalidArgumentException::class);
106109
$api = $this->getApiMock();
107110
$api->expects($this->any())
108111
->method('post');

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Tests\Api\TestCase;
46

57
class FollowersTest extends TestCase
68
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Tests\Api\TestCase;
46

57
class MembershipsTest extends TestCase
68
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Tests\Api\TestCase;
46

57
class StarringTest extends TestCase
68
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\CurrentUser;
4+
5+
use Github\Tests\Api\TestCase;
46

57
class WatchersTest extends TestCase
68
{

test/Github/Tests/Api/DeploymentTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Github\Tests\Api;
44

5+
use Github\Exception\MissingArgumentException;
6+
57
class DeploymentTest extends TestCase
68
{
79
/**
@@ -79,10 +81,10 @@ public function shouldCreateStatusUpdate()
7981

8082
/**
8183
* @test
82-
* @expectedException \Github\Exception\MissingArgumentException
8384
*/
8485
public function shouldRejectStatusUpdateWithoutStateField()
8586
{
87+
$this->expectException(MissingArgumentException::class);
8688
$api = $this->getApiMock();
8789
$statusData = ['description' => 'waiting to start'];
8890

test/Github/Tests/Api/GistsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Github\Tests\Api;
44

5+
use Github\Exception\MissingArgumentException;
6+
57
class GistsTest extends TestCase
68
{
79
/**
@@ -128,10 +130,10 @@ public function shouldListGistForks()
128130

129131
/**
130132
* @test
131-
* @expectedException \Github\Exception\MissingArgumentException
132133
*/
133134
public function shouldNotCreateGistWithoutFile()
134135
{
136+
$this->expectException(MissingArgumentException::class);
135137
$input = [
136138
'description' => '',
137139
'public' => false,

test/Github/Tests/Api/GitData/BlobsTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\GitData;
4+
5+
use Github\Exception\MissingArgumentException;
6+
use Github\Tests\Api\TestCase;
47

58
class BlobsTest extends TestCase
69
{
@@ -67,10 +70,10 @@ public function shouldCreateBlob()
6770

6871
/**
6972
* @test
70-
* @expectedException \Github\Exception\MissingArgumentException
7173
*/
7274
public function shouldNotCreateBlobWithoutEncoding()
7375
{
76+
$this->expectException(MissingArgumentException::class);
7477
$data = ['content' => 'some cotent'];
7578

7679
$api = $this->getApiMock();
@@ -82,10 +85,10 @@ public function shouldNotCreateBlobWithoutEncoding()
8285

8386
/**
8487
* @test
85-
* @expectedException \Github\Exception\MissingArgumentException
8688
*/
8789
public function shouldNotCreateBlobWithoutContent()
8890
{
91+
$this->expectException(MissingArgumentException::class);
8992
$data = ['encoding' => 'utf8'];
9093

9194
$api = $this->getApiMock();

test/Github/Tests/Api/GitData/CommitsTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\GitData;
4+
5+
use Github\Exception\MissingArgumentException;
6+
use Github\Tests\Api\TestCase;
47

58
class CommitsTest extends TestCase
69
{
@@ -39,10 +42,10 @@ public function shouldCreateCommit()
3942

4043
/**
4144
* @test
42-
* @expectedException \Github\Exception\MissingArgumentException
4345
*/
4446
public function shouldNotCreateCommitWithoutMessageParam()
4547
{
48+
$this->expectException(MissingArgumentException::class);
4649
$data = ['tree' => 1234, 'parents' => []];
4750

4851
$api = $this->getApiMock();
@@ -54,10 +57,10 @@ public function shouldNotCreateCommitWithoutMessageParam()
5457

5558
/**
5659
* @test
57-
* @expectedException \Github\Exception\MissingArgumentException
5860
*/
5961
public function shouldNotCreateCommitWithoutTreeParam()
6062
{
63+
$this->expectException(MissingArgumentException::class);
6164
$data = ['message' => 'some message', 'parents' => []];
6265

6366
$api = $this->getApiMock();
@@ -69,10 +72,10 @@ public function shouldNotCreateCommitWithoutTreeParam()
6972

7073
/**
7174
* @test
72-
* @expectedException \Github\Exception\MissingArgumentException
7375
*/
7476
public function shouldNotCreateCommitWithoutParentsParam()
7577
{
78+
$this->expectException(MissingArgumentException::class);
7679
$data = ['message' => 'some message', 'tree' => '12334'];
7780

7881
$api = $this->getApiMock();

test/Github/Tests/Api/GitData/ReferencesTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
namespace Github\Tests\Api;
3+
namespace Github\Tests\Api\GitData;
4+
5+
use Github\Exception\MissingArgumentException;
6+
use Github\Tests\Api\TestCase;
47

58
class ReferencesTest extends TestCase
69
{
@@ -119,10 +122,10 @@ public function shouldCreateReference()
119122

120123
/**
121124
* @test
122-
* @expectedException \Github\Exception\MissingArgumentException
123125
*/
124126
public function shouldNotCreateReferenceWithoutShaParam()
125127
{
128+
$this->expectException(MissingArgumentException::class);
126129
$data = ['ref' => '123'];
127130

128131
$api = $this->getApiMock();
@@ -134,10 +137,10 @@ public function shouldNotCreateReferenceWithoutShaParam()
134137

135138
/**
136139
* @test
137-
* @expectedException \Github\Exception\MissingArgumentException
138140
*/
139141
public function shouldNotCreateReferenceWithoutRefsParam()
140142
{
143+
$this->expectException(MissingArgumentException::class);
141144
$data = ['sha' => '1234'];
142145

143146
$api = $this->getApiMock();
@@ -166,10 +169,10 @@ public function shouldUpdateReference()
166169

167170
/**
168171
* @test
169-
* @expectedException \Github\Exception\MissingArgumentException
170172
*/
171173
public function shouldNoUpdateReferenceWithoutSha()
172174
{
175+
$this->expectException(MissingArgumentException::class);
173176
$data = [];
174177

175178
$api = $this->getApiMock();

0 commit comments

Comments
 (0)