Skip to content

Add PHPUnit to require-dev #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 6, 2017
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ install:
- composer install --no-interaction

script:
- phpunit --coverage-text
- vendor/bin/phpunit --coverage-text
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ It enables you to set and query its data or use its PubSub topics to react to in
* [close()](#close)
* [end()](#end)
* [Install](#install)
* [Tests](#tests)
* [License](#license)

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

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

## Tests

To run the test suite, you first need to clone this repo and then install all
dependencies [through Composer](http://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 @@ -22,6 +22,7 @@
"psr-4": { "Clue\\React\\Redis\\": "src/" }
},
"require-dev": {
"clue/block-react": "^1.1"
"clue/block-react": "^1.1",
"phpunit/phpunit": "^5.0 || ^4.8"
}
}
6 changes: 2 additions & 4 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use React\Socket\ConnectionInterface;

use Clue\React\Redis\Factory;
use React\Promise;

Expand All @@ -13,8 +11,8 @@ class FactoryTest extends TestCase

public function setUp()
{
$this->loop = $this->getMock('React\EventLoop\LoopInterface');
$this->connector = $this->getMock('React\SocketClient\ConnectorInterface');
$this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
$this->connector = $this->getMockBuilder('React\SocketClient\ConnectorInterface')->getMock();
$this->factory = new Factory($this->loop, $this->connector);
}

Expand Down
1 change: 0 additions & 1 deletion tests/FunctionalTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use React\Stream\Stream;
use React\Stream\ReadableStream;
use Clue\React\Redis\Factory;
use Clue\React\Redis\StreamingClient;
use React\Promise\Deferred;
Expand Down
4 changes: 2 additions & 2 deletions tests/StreamingClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class StreamingClientTest extends TestCase
public function setUp()
{
$this->stream = $this->getMockBuilder('React\Stream\Stream')->disableOriginalConstructor()->setMethods(array('write', 'close', 'resume', 'pause'))->getMock();
$this->parser = $this->getMock('Clue\Redis\Protocol\Parser\ParserInterface');
$this->serializer = $this->getMock('Clue\Redis\Protocol\Serializer\SerializerInterface');
$this->parser = $this->getMockBuilder('Clue\Redis\Protocol\Parser\ParserInterface')->getMock();
$this->serializer = $this->getMockBuilder('Clue\Redis\Protocol\Serializer\SerializerInterface')->getMock();

$this->client = new StreamingClient($this->stream, $this->parser, $this->serializer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function expectCallableOnceParameter($type)
*/
protected function createCallableMock()
{
return $this->getMock('CallableStub');
return $this->getMockBuilder('CallableStub')->getMock();
}

protected function expectPromiseResolve($promise)
Expand Down