Skip to content

Commit

Permalink
Merge pull request #112 from clue-labs/tests
Browse files Browse the repository at this point in the history
Test Mac OS X on Travis
  • Loading branch information
WyriHaximus authored Oct 10, 2017
2 parents bef86bb + ef3effa commit 13aa0e2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/DuplexResourceStreamIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -260,7 +260,7 @@ public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory)

$loop->run();

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

/**
Expand Down

0 comments on commit 13aa0e2

Please sign in to comment.