diff --git a/.travis.yml b/.travis.yml index a4aec7f..30be35b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,29 @@ language: php php: - - 5.3 +# - 5.3 # requires old distro, see below - 5.4 - 5.5 - 5.6 - - 7 - - hhvm + - 7.0 + - 7.1 + - 7.2 + - hhvm # ignore errors, see below + +# lock distro so future defaults will not break the build +dist: trusty + +matrix: + include: + - php: 5.3 + dist: precise + allow_failures: + - php: hhvm + +sudo: false install: - - composer install --prefer-source --no-interaction + - composer install --no-interaction script: - - phpunit --coverage-text + - vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index 21d6ae9..9aa94f4 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Among others, multicast networking is the basis for: * [createReceiver()](#createreceiver) * [Socket](#socket) * [Install](#install) +* [Tests](#tests) * [License](#license) ## Quickstart example @@ -134,6 +135,26 @@ The recommended way to install this library is [through Composer](http://getcomp $ composer require clue/multicast-react:~1.0 ``` +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 7+ and +HHVM. +It's *highly recommended to use PHP 7+* for this project. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org): + +```bash +$ composer install +``` + +To run the test suite, go to the project root and run: + +```bash +$ php vendor/bin/phpunit +``` + ## License MIT diff --git a/composer.json b/composer.json index 3018b68..4fa10da 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "react/datagram": "~1.0" }, "require-dev": { - "clue/hexdump": "0.2.*" + "clue/hexdump": "0.2.*", + "phpunit/phpunit": "^6.0 || ^5.7 || ^4.8.35" }, "suggest": { "php": "PHP 5.4+ is required for listening on multicast addresses (socket options to send IGMP announcements)", diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 20b2e2c..a809509 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -15,6 +15,7 @@ public function setUp() $this->factory = new Factory($this->loop); } + /** @doesNotPerformAssertions */ public function testSenderWithNoReceiver() { $sender = $this->factory->createSender(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 8711ee0..b27aa01 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,10 @@ createCallableMock(); - $mock - ->expects($this->once()) - ->method('__invoke') - ->with($this->isInstanceOf($type)); - - return $mock; - } - - /** - * @link https://github.com/reactphp/react/blob/master/tests/React/Tests/Socket/TestCase.php (taken from reactphp/react) - */ protected function createCallableMock() { - return $this->getMock('CallableStub'); + return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); } } - -class CallableStub -{ - public function __invoke() - { - } -} -