Skip to content

Commit 9c32239

Browse files
theodorejbNyholm
authored andcommitted
Add support for PHPUnit 8 (#41)
1 parent c3bb79c commit 9c32239

9 files changed

+16
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.tmp
2+
/.phpunit.result.cache
23
/behat.yml
34
/build/
45
/composer.lock

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ cache:
77
- $HOME/.composer/cache/files
88

99
php:
10-
- 7.1
10+
- 7.2
11+
- 7.3
1112

1213
env:
1314
global:

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^5.5 || ^7.0",
18-
"phpunit/phpunit": "^5.4 || ^6.0 || ^7.0",
17+
"php": "^7.2",
18+
"phpunit/phpunit": "^8.0",
1919
"psr/http-message": "^1.0"
2020
},
2121
"require-dev": {

src/MessageTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testGetHeader()
8282
$this->assertCount(2, $message->getHeader('CONTENT-TYPE'));
8383
$emptyHeader = $message->getHeader('Bar');
8484
$this->assertCount(0, $emptyHeader);
85-
$this->assertInternalType('array', $emptyHeader);
85+
$this->assertIsArray($emptyHeader);
8686
}
8787

8888
public function testGetHeaderLine()

src/RequestIntegrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class RequestIntegrationTest extends BaseTest
2727
*/
2828
abstract public function createSubject();
2929

30-
protected function setUp()
30+
protected function setUp(): void
3131
{
3232
$this->request = $this->createSubject();
3333
}

src/ResponseIntegrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract class ResponseIntegrationTest extends BaseTest
2626
*/
2727
abstract public function createSubject();
2828

29-
protected function setUp()
29+
protected function setUp(): void
3030
{
3131
$this->response = $this->createSubject();
3232
}

src/ServerRequestIntegrationTest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class ServerRequestIntegrationTest extends BaseTest
2424
*/
2525
abstract public function createSubject();
2626

27-
protected function setUp()
27+
protected function setUp(): void
2828
{
2929
$this->serverRequest = $this->createSubject();
3030
}
@@ -114,10 +114,11 @@ public function validParsedBodyParams()
114114

115115
/**
116116
* @dataProvider invalidParsedBodyParams
117-
* @expectedException \InvalidArgumentException
118117
*/
119118
public function testGetParsedBodyInvalid($value)
120119
{
120+
$this->expectException('\InvalidArgumentException');
121+
121122
if (isset($this->skippedTests[__FUNCTION__])) {
122123
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);
123124
}
@@ -145,7 +146,7 @@ public function testGetAttributes()
145146

146147
$new = $this->serverRequest->withAttribute('foo', 'bar');
147148
$oldAttributes = $this->serverRequest->getAttributes();
148-
$this->assertInternalType('array', $oldAttributes, 'getAttributes MUST return an array');
149+
$this->assertIsArray($oldAttributes, 'getAttributes MUST return an array');
149150
$this->assertEmpty($oldAttributes, 'withAttribute MUST be immutable');
150151
$this->assertEquals(['foo' => 'bar'], $new->getAttributes());
151152

src/StreamIntegrationTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,11 @@ public function testRewind()
238238

239239
/**
240240
* @group internet
241-
* @expectedException \RuntimeException
242241
*/
243242
public function testRewindNotSeekable()
244243
{
244+
$this->expectException('\RuntimeException');
245+
245246
if (isset($this->skippedTests[__FUNCTION__])) {
246247
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);
247248
}

src/UploadedFileIntegrationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ abstract class UploadedFileIntegrationTest extends BaseTest
2525
*/
2626
abstract public function createSubject();
2727

28-
public static function setUpBeforeClass()
28+
public static function setUpBeforeClass(): void
2929
{
3030
@mkdir('.tmp');
3131
parent::setUpBeforeClass();
3232
}
3333

34-
protected function setUp()
34+
protected function setUp(): void
3535
{
3636
$this->uploadedFile = $this->createSubject();
3737
}

0 commit comments

Comments
 (0)