Skip to content

Commit 0631701

Browse files
committed
Run tests on PHP 7.4 and simplify test matrix
1 parent a831b94 commit 0631701

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

.travis.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
language: php
22

3-
php:
4-
# - 5.3 # requires old distro, see below
5-
- 5.4
6-
- 5.5
7-
- 5.6
8-
- 7.0
9-
- 7.1
10-
- 7.2
11-
- 7.3
12-
# - 7.0 # Mac OS X, ignore errors, see below
13-
- hhvm # ignore errors, see below
14-
153
# lock distro so new future defaults will not break the build
164
dist: trusty
175

186
matrix:
197
include:
208
- php: 5.3
219
dist: precise
10+
- php: 5.4
11+
- php: 5.5
12+
- php: 5.6
13+
- php: 7.0
14+
- php: 7.1
15+
- php: 7.2
16+
- php: 7.3
17+
- php: 7.4
18+
- php: hhvm-3.18
19+
install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
2220
- os: osx
2321
language: generic
2422
php: 7.0 # just to look right on travis
2523
env:
2624
- PACKAGE: php70
2725
allow_failures:
28-
- php: hhvm
26+
- php: hhvm-3.18
2927
- os: osx
3028

3129
sudo: false
@@ -46,4 +44,4 @@ install:
4644
- composer install --no-interaction
4745

4846
script:
49-
- ./vendor/bin/phpunit --coverage-text
47+
- vendor/bin/phpunit --coverage-text

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"require-dev": {
1616
"clue/block-react": "^1.2",
17-
"phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
17+
"phpunit/phpunit": "^7.5 || ^6.4 || ^5.7 || ^4.8.35"
1818
},
1919
"autoload": {
2020
"psr-4": {

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>

tests/DnsConnectorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ public function testRejectionDuringDnsLookupShouldNotCreateAnyGarbageReferences(
202202
}
203203

204204
gc_collect_cycles();
205+
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on
205206

206207
$dns = new Deferred();
207208
$this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('example.com'))->willReturn($dns->promise());

tests/IntegrationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public function testCancellingPendingConnectionWithoutTimeoutShouldNotCreateAnyG
124124
$connector = new Connector($loop, array('timeout' => false));
125125

126126
gc_collect_cycles();
127+
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on
128+
127129
$promise = $connector->connect('8.8.8.8:80');
128130
$promise->cancel();
129131
unset($promise);

tests/SecureConnectorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public function testRejectionDuringConnectionShouldNotCreateAnyGarbageReferences
167167
}
168168

169169
gc_collect_cycles();
170+
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on
170171

171172
$tcp = new Deferred();
172173
$this->tcp->expects($this->once())->method('connect')->willReturn($tcp->promise());

tests/TcpConnectorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public function testCancelDuringConnectionShouldNotCreateAnyGarbageReferences()
268268
}
269269

270270
gc_collect_cycles();
271+
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on
271272

272273
$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
273274
$connector = new TcpConnector($loop);

0 commit comments

Comments
 (0)