Skip to content

Commit 13aa0e2

Browse files
authored
Merge pull request #112 from clue-labs/tests
Test Mac OS X on Travis
2 parents bef86bb + ef3effa commit 13aa0e2

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ php:
66
- 5.5
77
- 5.6
88
- 7.0
9+
# - 7.0 # Mac OS X test setup, see below
910
- 7.1
1011
- nightly # ignore errors, see below
1112
- hhvm # ignore errors, see below
@@ -17,11 +18,29 @@ matrix:
1718
include:
1819
- php: 5.3
1920
dist: precise
21+
include:
22+
- os: osx
23+
language: generic
24+
php: 7.0 # just to look right on travis
25+
env:
26+
- PACKAGE: php70
2027
allow_failures:
2128
- php: nightly
2229
- php: hhvm
2330

2431
install:
32+
# OSX install inspired by https://github.com/kiler129/TravisCI-OSX-PHP
33+
- |
34+
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
35+
brew tap homebrew/homebrew-php
36+
echo "Installing PHP ..."
37+
brew install "${PACKAGE}"
38+
brew install "${PACKAGE}"-xdebug
39+
brew link "${PACKAGE}"
40+
echo "Installing composer ..."
41+
curl -s http://getcomposer.org/installer | php
42+
mv composer.phar /usr/local/bin/composer
43+
fi
2544
- composer install --no-interaction
2645

2746
script:

tests/DuplexResourceStreamIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory)
248248

249249
$loop = $loopFactory();
250250

251-
$stream = new ReadableResourceStream(popen('echo -n a;sleep 0.1;echo -n b;sleep 0.1;echo -n c', 'r'), $loop);
251+
$stream = new ReadableResourceStream(popen('echo a;sleep 0.1;echo b;sleep 0.1;echo c', 'r'), $loop);
252252

253253
$buffer = '';
254254
$stream->on('data', function ($chunk) use (&$buffer) {
@@ -260,7 +260,7 @@ public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory)
260260

261261
$loop->run();
262262

263-
$this->assertEquals('abc', $buffer);
263+
$this->assertEquals("a\n" . "b\n" . "c\n", $buffer);
264264
}
265265

266266
/**

0 commit comments

Comments
 (0)