Skip to content

Commit cdeab3c

Browse files
authored
Merge pull request #17 from clue-labs/tests
Update Travis build config so new defaults do not break the build
2 parents af1fd4f + cf99d2a commit cdeab3c

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
language: php
22

33
php:
4-
- 5.3
4+
# - 5.3 # requires old distro, see below
55
- 5.4
66
- 5.5
77
- 5.6
88
- 7
9-
- hhvm
9+
- hhvm # ignore errors, see below
10+
11+
# lock distro so new future defaults will not break the build
12+
dist: trusty
13+
14+
matrix:
15+
include:
16+
- php: 5.3
17+
dist: precise
18+
allow_failures:
19+
- php: hhvm
1020

1121
sudo: false
1222

1323
install:
14-
- composer install --prefer-source --no-interaction
24+
- composer install --no-interaction
1525

1626
script:
17-
- phpunit --coverage-text
27+
- vendor/bin/phpunit --coverage-text

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ $ composer require react/datagram:^1.1.1
4343

4444
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
4545

46+
## Tests
47+
48+
To run the test suite, you first need to clone this repo and then install all
49+
dependencies [through Composer](http://getcomposer.org):
50+
51+
```bash
52+
$ composer install
53+
```
54+
55+
To run the test suite, go to the project root and run:
56+
57+
```bash
58+
$ php vendor/bin/phpunit
59+
```
60+
4661
## License
4762

4863
MIT

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"react/promise": "~2.1|~1.2"
2222
},
2323
"require-dev": {
24-
"clue/block-react": "~1.0"
24+
"clue/block-react": "~1.0",
25+
"phpunit/phpunit": "^5.0 || ^4.8"
2526
}
2627
}

tests/FactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function testCancelCreateClientWithCancellableHostnameResolver()
162162

163163
public function testCancelCreateClientWithUncancellableHostnameResolver()
164164
{
165-
$promise = $this->getMock('React\Promise\PromiseInterface');
165+
$promise = $this->getMockBuilder('React\Promise\PromiseInterface')->getMock();
166166
$this->resolver->expects($this->once())->method('resolve')->with('example.com')->willReturn($promise);
167167

168168
$promise = $this->factory->createClient('example.com:0');

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function expectCallableNever()
2626

2727
protected function createCallableMock()
2828
{
29-
return $this->getMock('CallableStub');
29+
return $this->getMockBuilder('CallableStub')->getMock();
3030
}
3131

3232
protected function createResolverMock()

0 commit comments

Comments
 (0)