Skip to content

Commit b370eb7

Browse files
authored
Merge pull request #9 from thklein/tests
Add PHPUnit to require-dev
2 parents d162cca + f1fa490 commit b370eb7

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ install:
1414
- composer install --no-interaction
1515

1616
script:
17-
- phpunit --coverage-text
17+
- vendor/bin/phpunit --coverage-text

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Streaming UTF-8 parser for React PHP
77
* [Usage](#usage)
88
* [Sequencer](#sequencer)
99
* [Install](#install)
10+
* [Tests](#tests)
1011
* [License](#license)
1112
* [More](#more)
1213

@@ -65,6 +66,21 @@ $ composer require clue/utf8-react:^0.1
6566

6667
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
6768

69+
## Tests
70+
71+
To run the test suite, you first need to clone this repo and then install all
72+
dependencies [through Composer](http://getcomposer.org):
73+
74+
```bash
75+
$ composer install
76+
```
77+
78+
To run the test suite, go to the project root and run:
79+
80+
```bash
81+
$ php vendor/bin/phpunit
82+
```
83+
6884
## License
6985

7086
MIT

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
"require": {
1717
"php": ">=5.3",
1818
"react/stream": "^0.4 || ^0.3"
19+
},
20+
"require-dev": {
21+
"phpunit/phpunit": "^5.0 || ^4.8"
1922
}
2023
}

tests/SequencerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function testEmitErrorEventWillForwardAndClose()
251251

252252
public function testPipeReturnsDestStream()
253253
{
254-
$dest = $this->getMock('React\Stream\WritableStreamInterface');
254+
$dest = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
255255

256256
$ret = $this->sequencer->pipe($dest);
257257

@@ -260,7 +260,7 @@ public function testPipeReturnsDestStream()
260260

261261
public function testForwardPauseToInput()
262262
{
263-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
263+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
264264
$this->input->expects($this->once())->method('pause');
265265

266266
$this->sequencer = new Sequencer($this->input);
@@ -269,7 +269,7 @@ public function testForwardPauseToInput()
269269

270270
public function testForwardResumeToInput()
271271
{
272-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
272+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
273273
$this->input->expects($this->once())->method('resume');
274274

275275
$this->sequencer = new Sequencer($this->input);

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function expectCallableOnceParameter($type)
5353
*/
5454
protected function createCallableMock()
5555
{
56-
return $this->getMock('CallableStub');
56+
return $this->getMockBuilder('CallableStub')->getMock();
5757
}
5858
}
5959

0 commit comments

Comments
 (0)