Skip to content

Commit

Permalink
Merge pull request #50 from clue-labs/tests
Browse files Browse the repository at this point in the history
Add PHPUnit to require-dev
  • Loading branch information
clue authored Apr 14, 2017
2 parents 61af8dc + 6645b7f commit 74017c5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,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 @@ -25,6 +25,7 @@ of the actual application level protocol, such as HTTP, SMTP, IMAP, Telnet etc.
* [Using SSH as a SOCKS server](#using-ssh-as-a-socks-server)
* [Using the Tor (anonymity network) to tunnel SOCKS connections](#using-the-tor-anonymity-network-to-tunnel-socks-connections)
* [Install](#install)
* [Tests](#tests)
* [License](#license)
* [More](#more)

Expand Down Expand Up @@ -531,6 +532,21 @@ $ composer require clue/socks-react:^0.6

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, see LICENSE
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react/promise": "^2.1 || ^1.2"
},
"require-dev": {
"phpunit/phpunit": "^5.0 || ^4.8",
"react/event-loop": "0.3.*|0.4.*",
"react/dns": "0.3.*|0.4.*",
"clue/socks-server": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ClientTest extends TestCase
public function setUp()
{
$this->loop = React\EventLoop\Factory::create();
$this->connector = $this->getMock('React\SocketClient\ConnectorInterface');
$this->connector = $this->getMockBuilder('React\SocketClient\ConnectorInterface')->getMock();
$this->client = new Client('127.0.0.1:1080', $this->connector);
}

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

0 comments on commit 74017c5

Please sign in to comment.