Skip to content

Commit

Permalink
Added PHP 8 support.
Browse files Browse the repository at this point in the history
Dropped PHP 7.1 support.
  • Loading branch information
Bilge committed Dec 15, 2020
1 parent 8317537 commit 4cd0ac5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ notifications:
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

env:
matrix:
Expand All @@ -22,12 +22,12 @@ cache:
- vendor

install:
- composer self-update --1
- composer validate
- composer --no-interaction update $DEPENDENCIES

script:
- composer test -- --coverage-clover=build/logs/clover.xml --coverage-xml=build/coverage/coverage-xml
--log-junit=build/coverage/phpunit.junit.xml
- XDEBUG_MODE=coverage composer test -- --coverage-clover=build/logs/clover.xml
--coverage-xml=build/coverage/coverage-xml --log-junit=build/coverage/junit.xml
- travis_retry bash <(curl -s https://codecov.io/bash) || true
- composer mutation -- --min-msi=100 --threads=$(nproc) --show-mutations --coverage=build/coverage
- ln -sfv ../build test
- composer mutation -- --min-msi=99 --threads=$(nproc) --show-mutations --coverage=build/coverage
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"license": "LGPL-3.0",
"require": {
"php": "^7.1",
"php": "^7.2|^8",
"amphp/amp": "^2",
"async/throttle": "^3",
"psr/cache": "^1",
Expand All @@ -20,9 +20,9 @@
},
"require-dev": {
"amphp/phpunit-util": "^1.1",
"infection/infection": "^0.13",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^7.1.3"
"infection/infection": ">=0.15,<1",
"mockery/mockery": "^1.4.2",
"phpunit/phpunit": "^8.5|^9"
},
"suggest" : {
"connectors/http": "Provides an HTTP connector for Porter providers.",
Expand Down
2 changes: 1 addition & 1 deletion test/Integration/Connector/ImportConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class ImportConnectorTest extends TestCase
/** @var AsyncDataSource|MockInterface */
private $asyncSource;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion test/Integration/PorterAsyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testImportIncompatibleProviderAsync(): \Generator
$this->registerProvider(\Mockery::mock(Provider::class), $providerName = 'foo');

$this->expectException(IncompatibleProviderException::class);
$this->expectExceptionMessageRegExp('[\bAsyncProvider\b]');
$this->expectExceptionMessageMatches('[\bAsyncProvider\b]');
yield $this->porter->importAsync($this->specification->setProviderName($providerName));
}

Expand Down
2 changes: 1 addition & 1 deletion test/Integration/PorterSyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function testImportIncompatibleProvider(): void
$this->registerProvider(\Mockery::mock(AsyncProvider::class), $providerName = 'foo');

$this->expectException(IncompatibleProviderException::class);
$this->expectExceptionMessageRegExp('[\bProvider\b]');
$this->expectExceptionMessageMatches('[\bProvider\b]');
$this->porter->import($this->specification->setProviderName($providerName));
}

Expand Down
2 changes: 1 addition & 1 deletion test/Unit/Collection/RecordCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testNonArrayYield(): void
)->makePartial();

$this->expectException(\TypeError::class);
$this->expectExceptionMessage('must be of the type array');
$this->expectExceptionMessageMatches('[must be of( the)? type array]');
$collection->current();
}
}
2 changes: 1 addition & 1 deletion test/Unit/Connector/ImportConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ImportConnectorTest extends TestCase
/** @var DataSource|MockInterface */
private $source;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
6 changes: 6 additions & 0 deletions test/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<testsuite name="all">
<directory>.</directory>
</testsuite>
<coverage processUncoveredFiles="true">
<include>
<directory>../src</directory>
</include>
</coverage>
<!-- TODO: Remove obsolete block when support for PHPUnit 8 dropped. -->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory>../src</directory>
Expand Down

0 comments on commit 4cd0ac5

Please sign in to comment.