From 1d5d370ccec0f6b555567aca1f9a1f4e5d8df29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 7 Apr 2017 22:09:40 +0200 Subject: [PATCH 1/2] Add PHPUnit to require-dev --- .travis.yml | 2 +- README.md | 16 ++++++++++++++++ composer.json | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3464291..6983d72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ install: - composer install --no-interaction script: - - phpunit --coverage-text + - vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index 4ac00ba..c4966d7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Async HTTP CONNECT proxy connector, use any TCP/IP protocol through an HTTP prox * [create()](#create) * [ProxyConnector](#proxyconnector) * [Install](#install) +* [Tests](#tests) * [License](#license) * [More](#more) @@ -178,6 +179,21 @@ $ composer require clue/http-proxy-react:^0.1 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 diff --git a/composer.json b/composer.json index 7bc8f7e..3e5c729 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "ringcentral/psr7": "^1.2" }, "require-dev": { + "phpunit/phpunit": "^4.8", "react/socket-client": "^0.5", "clue/block-react": "^1.1" } From c790a631a96db80e278f5a165745cf570a3513ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 7 Apr 2017 22:10:52 +0200 Subject: [PATCH 2/2] Compatiblility with PHPUnit v5 --- composer.json | 2 +- tests/AbstractTestCase.php | 2 +- tests/ProxyConnectorTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3e5c729..6092d34 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "ringcentral/psr7": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^4.8", + "phpunit/phpunit": "^5.0 || ^4.8", "react/socket-client": "^0.5", "clue/block-react": "^1.1" } diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index b77647e..3250568 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -53,7 +53,7 @@ protected function expectCallableOnceParameter($type) */ protected function createCallableMock() { - return $this->getMock('Tests\\Clue\\React\\HttpProxy\\CallableStub'); + return $this->getMockBuilder('Tests\\Clue\\React\\HttpProxy\\CallableStub')->getMock(); } } diff --git a/tests/ProxyConnectorTest.php b/tests/ProxyConnectorTest.php index 8d5baf7..66cf6de 100644 --- a/tests/ProxyConnectorTest.php +++ b/tests/ProxyConnectorTest.php @@ -12,7 +12,7 @@ class ProxyConnectorTest extends AbstractTestCase public function setUp() { - $this->connector = $this->getMock('React\SocketClient\ConnectorInterface'); + $this->connector = $this->getMockBuilder('React\SocketClient\ConnectorInterface')->getMock(); } /**