diff --git a/.travis.yml b/.travis.yml index d5118a82..6b771592 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,8 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm - - hhvm-nightly - -matrix: - allow_failures: - - php: hhvm - - php: hhvm-nightly - fast_finish: true install: ./travis-init.sh diff --git a/src/ExtEventLoop.php b/src/ExtEventLoop.php index 48657f96..7160c908 100644 --- a/src/ExtEventLoop.php +++ b/src/ExtEventLoop.php @@ -294,7 +294,7 @@ private function unsubscribeStreamEvent($stream, $flag) */ private function createTimerCallback() { - $this->timerCallback = function ($_, $_, $timer) { + $this->timerCallback = function ($_, $__, $timer) { call_user_func($timer->getCallback(), $timer); if (!$timer->isPeriodic() && $this->isTimerActive($timer)) { diff --git a/src/LibEventLoop.php b/src/LibEventLoop.php index 6fbc8269..99417a12 100644 --- a/src/LibEventLoop.php +++ b/src/LibEventLoop.php @@ -298,7 +298,7 @@ private function unsubscribeStreamEvent($stream, $flag) */ private function createTimerCallback() { - $this->timerCallback = function ($_, $_, $timer) { + $this->timerCallback = function ($_, $__, $timer) { call_user_func($timer->getCallback(), $timer); // Timer already cancelled ... diff --git a/tests/AbstractLoopTest.php b/tests/AbstractLoopTest.php index 17163e8b..29bde5aa 100644 --- a/tests/AbstractLoopTest.php +++ b/tests/AbstractLoopTest.php @@ -176,7 +176,7 @@ public function runShouldReturnWhenNoMoreFds() $this->writeToStream($input, "foo\n"); - $this->assertRunFasterThan(0.005); + $this->assertRunFasterThan(0.015); } /** @test */ @@ -194,7 +194,7 @@ public function stopShouldStopRunningLoop() $this->assertRunFasterThan(0.005); } - public function testStopShouldPreventRunFromBlocking() + public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005) { $this->loop->addTimer( 1, @@ -209,7 +209,7 @@ function () { } ); - $this->assertRunFasterThan(0.005); + $this->assertRunFasterThan($timeLimit); } public function testIgnoreRemovedCallback() diff --git a/tests/StreamSelectLoopTest.php b/tests/StreamSelectLoopTest.php index 61b059c1..624ee447 100644 --- a/tests/StreamSelectLoopTest.php +++ b/tests/StreamSelectLoopTest.php @@ -37,6 +37,17 @@ public function testStreamSelectTimeoutEmulation() $this->assertGreaterThan(0.04, $interval); } + public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005) + { + if (defined('HHVM_VERSION')) { + // HHVM is a bit slow, so give it more time + parent::testStopShouldPreventRunFromBlocking(0.5); + } else { + parent::testStopShouldPreventRunFromBlocking($timeLimit); + } + } + + public function signalProvider() { return [ diff --git a/travis-init.sh b/travis-init.sh index 63deeb85..07b1d2a8 100755 --- a/travis-init.sh +++ b/travis-init.sh @@ -11,25 +11,29 @@ if [[ "$TRAVIS_PHP_VERSION" != "hhvm" && # install 'event' PHP extension echo "yes" | pecl install event - # install 'libevent' PHP extension - curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz - pushd libevent-0.1.0 - phpize - ./configure - make - make install - popd - echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')" + # install 'libevent' PHP extension (does not support php 7) + if [[ "$TRAVIS_PHP_VERSION" != "7.0" ]]; then + curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz + pushd libevent-0.1.0 + phpize + ./configure + make + make install + popd + echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')" + fi - # install 'libev' PHP extension - git clone --recursive https://github.com/m4rw3r/php-libev - pushd php-libev - phpize - ./configure --with-libev - make - make install - popd - echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')" + # install 'libev' PHP extension (does not support php 7) + if [[ "$TRAVIS_PHP_VERSION" != "7.0" ]]; then + git clone --recursive https://github.com/m4rw3r/php-libev + pushd php-libev + phpize + ./configure --with-libev + make + make install + popd + echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')" + fi fi pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy