Skip to content

Commit 060757f

Browse files
committed
feat: PHP 8 support
- Updates PHP constraint to `^7.3 || ~8.0.0` - Updates PHPUnit constraint to `^9.3` - Removes constraint for phpspec/prophecy - Updates Travis job matrix to cover 7.3, 7.4, and 8.0 - Migrates tests from Prophecy to PHPUnit mocks - Extracts data providers where they make sense Signed-off-by: Matthew Weier O'Phinney <[email protected]>
1 parent 42f39a3 commit 060757f

12 files changed

+374
-284
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.phpunit.result.cache
12
/clover.xml
23
/composer.lock
34
/coveralls-upload.json

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ cache:
66

77
env:
88
global:
9-
- COMPOSER_ARGS="--no-interaction"
9+
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
1010
- COVERAGE_DEPS="php-coveralls/php-coveralls"
1111

1212
matrix:
1313
fast_finish: true
1414
include:
15-
- php: 7.1
15+
- php: 7.3
1616
env:
1717
- DEPS=lowest
18-
- php: 7.1
18+
- php: 7.3
1919
env:
2020
- DEPS=latest
21-
- CS_CHECK=true
22-
- TEST_COVERAGE=true
23-
- php: 7.2
21+
- php: 7.4
2422
env:
2523
- DEPS=lowest
26-
- php: 7.2
24+
- php: 7.4
2725
env:
2826
- DEPS=latest
29-
- php: 7.3
27+
- CS_CHECK=true
28+
- TEST_COVERAGE=true
29+
- php: nightly
3030
env:
3131
- DEPS=lowest
32-
- php: 7.3
32+
- php: nightly
3333
env:
3434
- DEPS=latest
3535

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@
2727
}
2828
},
2929
"require": {
30-
"php": "^7.1",
31-
"dflydev/fig-cookies": "^1.0.2 || ^2.0",
30+
"php": "^7.3 || ~8.0.0",
31+
"dflydev/fig-cookies": "^2.0.1",
3232
"laminas/laminas-zendframework-bridge": "^1.0",
3333
"psr/container": "^1.0",
3434
"psr/http-server-middleware": "^1.0"
3535
},
3636
"require-dev": {
3737
"laminas/laminas-coding-standard": "~1.0.0",
3838
"laminas/laminas-diactoros": "^2.2",
39-
"phpunit/phpunit": "^6.5.5"
40-
},
41-
"conflict": {
42-
"phpspec/prophecy": "<1.7.2"
39+
"phpunit/phpunit": "^9.3"
4340
},
4441
"suggest": {
4542
"mezzio/mezzio-csrf": "^1.0 || ^1.0-dev for CSRF protection capabilities",

phpunit.xml.dist

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true">
6-
<testsuites>
7-
<testsuite name="mezzio-session">
8-
<directory>./test</directory>
9-
</testsuite>
10-
</testsuites>
11-
12-
<filter>
13-
<whitelist processUncoveredFilesFromWhitelist="true">
14-
<directory suffix=".php">./src</directory>
15-
</whitelist>
16-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="mezzio-session">
10+
<directory>./test</directory>
11+
</testsuite>
12+
</testsuites>
1713
</phpunit>

test/ConfigProviderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@
1515

1616
class ConfigProviderTest extends TestCase
1717
{
18-
public function setUp()
18+
public function setUp(): void
1919
{
2020
$this->provider = new ConfigProvider();
2121
}
2222

23-
public function testInvocationReturnsArray()
23+
public function testInvocationReturnsArray(): array
2424
{
2525
$config = ($this->provider)();
26-
$this->assertInternalType('array', $config);
26+
$this->assertIsArray($config);
2727
return $config;
2828
}
2929

3030
/**
3131
* @depends testInvocationReturnsArray
3232
*/
33-
public function testReturnedArrayContainsDependencies(array $config)
33+
public function testReturnedArrayContainsDependencies(array $config): void
3434
{
3535
$this->assertArrayHasKey('dependencies', $config);
36-
$this->assertInternalType('array', $config['dependencies']);
36+
$this->assertIsArray($config['dependencies']);
3737
}
3838
}

0 commit comments

Comments
 (0)