Skip to content

Commit 19726d3

Browse files
authored
Merge pull request #4 from clue-labs/tests
Test against legacy PHP 5.3 through PHP 7.1 and HHVM
2 parents d5618a6 + e0f7cd4 commit 19726d3

5 files changed

Lines changed: 38 additions & 6 deletions

File tree

.travis.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
language: php
2+
23
php:
34
- 5.3
5+
- 5.4
6+
- 5.5
47
- 5.6
5-
- hhvm
8+
- 7.0
9+
- 7.1
10+
11+
# also test against HHVM, but require "trusty" and ignore errors
12+
matrix:
13+
include:
14+
- php: hhvm
15+
dist: trusty
16+
allow_failures:
17+
- php: hhvm
18+
619
install:
7-
- composer install --prefer-source --no-interaction
20+
- composer install --no-interaction
21+
822
script:
9-
- phpunit --coverage-text
23+
- vendor/bin/phpunit --coverage-text

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ The recommended way to install this library is [through composer](http://getcomp
2020
}
2121
```
2222

23+
## Tests
24+
25+
To run the test suite, you first need to clone this repo and then install all
26+
dependencies [through Composer](http://getcomposer.org):
27+
28+
```bash
29+
$ composer install
30+
```
31+
32+
To run the test suite, go to the project root and run:
33+
34+
```bash
35+
$ php vendor/bin/phpunit
36+
```
37+
2338
## License
2439

2540
MIT

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"react/event-loop": "~0.4.0|~0.3.0",
1919
"react/http": "~0.4.0|~0.3.0",
2020
"react/stream": "~0.4.0|~0.3.0"
21+
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^5.0 || ^4.8"
2124
}
2225
}

tests/BufferedChannelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class BufferedChannelTest extends TestCase
66
{
77
public function testNumberOfWritesToStream()
88
{
9-
$stream = $this->getMock('React\Stream\WritableStreamInterface');
9+
$stream = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
1010

1111
$called = 0;
1212
$stream->expects($this->any())->method('write')->will($this->returnCallback(function () use (&$called) {
@@ -44,7 +44,7 @@ public function testNumberOfWritesToStream()
4444

4545
public function testResultingStreamBuffer()
4646
{
47-
$stream = $this->getMock('React\Stream\WritableStreamInterface');
47+
$stream = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
4848

4949
$buffered = '';
5050
$stream->expects($this->any())->method('write')->will($this->returnCallback(function ($data) use (&$buffered) {

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function expectCallableOnce()
2020
*/
2121
protected function createCallableMock()
2222
{
23-
return $this->getMock('CallableStub');
23+
return $this->getMockBuilder('CallableStub')->getMock();
2424
}
2525
}
2626

0 commit comments

Comments
 (0)