Skip to content

Commit 7cee02b

Browse files
authored
Merge pull request #53 from clue-labs/tests
Add PHPUnit to require-dev
2 parents 47afc46 + ca3de3e commit 7cee02b

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ install:
1717
- composer install --no-interaction
1818

1919
script:
20-
- phpunit --coverage-text
20+
- vendor/bin/phpunit --coverage-text

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ It enables you to set and query its data or use its PubSub topics to react to in
3434
* [close()](#close)
3535
* [end()](#end)
3636
* [Install](#install)
37+
* [Tests](#tests)
3738
* [License](#license)
3839

3940
## Quickstart example
@@ -248,6 +249,21 @@ $ composer require "clue/redis-react:^1.0 || ^0.5"
248249

249250
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
250251

252+
## Tests
253+
254+
To run the test suite, you first need to clone this repo and then install all
255+
dependencies [through Composer](http://getcomposer.org):
256+
257+
```bash
258+
$ composer install
259+
```
260+
261+
To run the test suite, go to the project root and run:
262+
263+
```bash
264+
$ php vendor/bin/phpunit
265+
```
266+
251267
## License
252268

253269
MIT

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"psr-4": { "Clue\\React\\Redis\\": "src/" }
2323
},
2424
"require-dev": {
25-
"clue/block-react": "^1.1"
25+
"clue/block-react": "^1.1",
26+
"phpunit/phpunit": "^5.0 || ^4.8"
2627
}
2728
}

tests/FactoryTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use React\Socket\ConnectionInterface;
4-
53
use Clue\React\Redis\Factory;
64
use React\Promise;
75

@@ -13,8 +11,8 @@ class FactoryTest extends TestCase
1311

1412
public function setUp()
1513
{
16-
$this->loop = $this->getMock('React\EventLoop\LoopInterface');
17-
$this->connector = $this->getMock('React\SocketClient\ConnectorInterface');
14+
$this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
15+
$this->connector = $this->getMockBuilder('React\SocketClient\ConnectorInterface')->getMock();
1816
$this->factory = new Factory($this->loop, $this->connector);
1917
}
2018

tests/FunctionalTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use React\Stream\Stream;
4-
use React\Stream\ReadableStream;
54
use Clue\React\Redis\Factory;
65
use Clue\React\Redis\StreamingClient;
76
use React\Promise\Deferred;

tests/StreamingClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class StreamingClientTest extends TestCase
1919
public function setUp()
2020
{
2121
$this->stream = $this->getMockBuilder('React\Stream\Stream')->disableOriginalConstructor()->setMethods(array('write', 'close', 'resume', 'pause'))->getMock();
22-
$this->parser = $this->getMock('Clue\Redis\Protocol\Parser\ParserInterface');
23-
$this->serializer = $this->getMock('Clue\Redis\Protocol\Serializer\SerializerInterface');
22+
$this->parser = $this->getMockBuilder('Clue\Redis\Protocol\Parser\ParserInterface')->getMock();
23+
$this->serializer = $this->getMockBuilder('Clue\Redis\Protocol\Serializer\SerializerInterface')->getMock();
2424

2525
$this->client = new StreamingClient($this->stream, $this->parser, $this->serializer);
2626
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function expectCallableOnceParameter($type)
4949
*/
5050
protected function createCallableMock()
5151
{
52-
return $this->getMock('CallableStub');
52+
return $this->getMockBuilder('CallableStub')->getMock();
5353
}
5454

5555
protected function expectPromiseResolve($promise)

0 commit comments

Comments
 (0)