From bb80b85de6e720023daf990357eb70e19b701c4d Mon Sep 17 00:00:00 2001 From: andig Date: Mon, 9 Oct 2017 20:34:06 +0200 Subject: [PATCH 1/2] Test Mac OS X on Travis Squashed by @clue, originally from https://github.com/reactphp/socket/pull/124 --- .travis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index b3fafdf..37a14d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ php: - 5.5 - 5.6 - 7.0 +# - 7.0 # Mac OS X test setup, see below - 7.1 - nightly # ignore errors, see below - hhvm # ignore errors, see below @@ -17,11 +18,29 @@ matrix: include: - php: 5.3 dist: precise + include: + - os: osx + language: generic + php: 7.0 # just to look right on travis + env: + - PACKAGE: php70 allow_failures: - php: nightly - php: hhvm install: + # OSX install inspired by https://github.com/kiler129/TravisCI-OSX-PHP + - | + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + brew tap homebrew/homebrew-php + echo "Installing PHP ..." + brew install "${PACKAGE}" + brew install "${PACKAGE}"-xdebug + brew link "${PACKAGE}" + echo "Installing composer ..." + curl -s http://getcomposer.org/installer | php + mv composer.phar /usr/local/bin/composer + fi - composer install --no-interaction script: From ef3effa2c69c60dd9cec1314cb8221d9e4ccb5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Mon, 9 Oct 2017 20:04:08 +0200 Subject: [PATCH 2/2] Do not rely on `echo -n` to also support Mac OS X --- tests/DuplexResourceStreamIntegrationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/DuplexResourceStreamIntegrationTest.php b/tests/DuplexResourceStreamIntegrationTest.php index 37d05da..f7f2860 100644 --- a/tests/DuplexResourceStreamIntegrationTest.php +++ b/tests/DuplexResourceStreamIntegrationTest.php @@ -248,7 +248,7 @@ public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory) $loop = $loopFactory(); - $stream = new ReadableResourceStream(popen('echo -n a;sleep 0.1;echo -n b;sleep 0.1;echo -n c', 'r'), $loop); + $stream = new ReadableResourceStream(popen('echo a;sleep 0.1;echo b;sleep 0.1;echo c', 'r'), $loop); $buffer = ''; $stream->on('data', function ($chunk) use (&$buffer) { @@ -260,7 +260,7 @@ public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory) $loop->run(); - $this->assertEquals('abc', $buffer); + $this->assertEquals("a\n" . "b\n" . "c\n", $buffer); } /**