Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Among others, multicast networking is the basis for:
* [createReceiver()](#createreceiver)
* [Socket](#socket)
* [Install](#install)
* [Tests](#tests)
* [License](#license)

## Quickstart example
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
1 change: 1 addition & 0 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function setUp()
$this->factory = new Factory($this->loop);
}

/** @doesNotPerformAssertions */
public function testSenderWithNoReceiver()
{
$sender = $this->factory->createSender();
Expand Down
28 changes: 3 additions & 25 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

require_once __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

error_reporting(-1);

class TestCase extends PHPUnit_Framework_TestCase
class TestCase extends PHPUnit\Framework\TestCase
{
protected function expectCallableOnce()
{
Expand Down Expand Up @@ -39,30 +39,8 @@ protected function expectCallableNever()
return $mock;
}

protected function expectCallableOnceParameter($type)
{
$mock = $this->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()
{
}
}