Skip to content

Commit 3159a40

Browse files
authored
Merge pull request clue#97 from clue-labs/php7.4
Run tests on PHP 7.4 and simplify test matrix
2 parents 5bc182e + 88bfb66 commit 3159a40

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.travis.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
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-
- hhvm # ignore errors, see below
13-
143
# lock distro so new future defaults will not break the build
154
dist: trusty
165

176
matrix:
187
include:
198
- php: 5.3
209
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:
20+
- composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
2121
allow_failures:
22-
- php: hhvm
22+
- php: hhvm-3.18
2323

2424
services:
2525
- redis-server

src/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function ($error) use ($client) {
116116
$promise->then(array($deferred, 'resolve'), array($deferred, 'reject'));
117117

118118
// use timeout from explicit ?timeout=x parameter or default to PHP's default_socket_timeout (60)
119-
$timeout = (float) isset($parts['timeout']) ? $parts['timeout'] : ini_get("default_socket_timeout");
119+
$timeout = isset($parts['timeout']) ? $parts['timeout'] : (int) ini_get("default_socket_timeout");
120120
if ($timeout < 0) {
121121
return $deferred->promise();
122122
}
@@ -194,7 +194,7 @@ private function parseUrl($target)
194194
}
195195

196196
if (isset($args['timeout'])) {
197-
$ret['timeout'] = $args['timeout'];
197+
$ret['timeout'] = (float) $args['timeout'];
198198
}
199199
}
200200

tests/FactoryStreamingClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ public function testCreateClientWithNegativeTimeoutParameterWillNotStartTimer()
324324

325325
public function testCreateClientWithoutTimeoutParameterWillStartTimerWithDefaultTimeoutFromIni()
326326
{
327-
$this->loop->expects($this->once())->method('addTimer')->with(1.5, $this->anything());
327+
$this->loop->expects($this->once())->method('addTimer')->with(42, $this->anything());
328328

329329
$deferred = new Deferred();
330330
$this->connector->expects($this->once())->method('connect')->with('127.0.0.1:2')->willReturn($deferred->promise());
331331

332332
$old = ini_get('default_socket_timeout');
333-
ini_set('default_socket_timeout', '1.5');
333+
ini_set('default_socket_timeout', '42');
334334
$this->factory->createClient('redis://127.0.0.1:2');
335335
ini_set('default_socket_timeout', $old);
336336
}

0 commit comments

Comments
 (0)