From 4d2505e19e93e9d454866fd576f6e4c505724129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 18 Aug 2017 13:21:45 +0200 Subject: [PATCH 1/2] Add PHPUnit to require-dev --- .travis.yml | 7 +++++-- README.md | 16 ++++++++++++++++ composer.json | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0421f85..0d6fd77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: php + php: - 5.3 - 5.4 @@ -6,7 +7,9 @@ php: - 5.6 - 7 - hhvm + install: - - composer install --prefer-source --no-interaction + - composer install --no-interaction + script: - - phpunit --coverage-text --verbose || ([[ $? = 139 ]] && echo && echo "Ignoring SEGFAULT.." >&2) + - vendor/bin/phpunit --coverage-text --verbose || ([[ $? = 139 ]] && echo && echo "Ignoring SEGFAULT.." >&2) diff --git a/README.md b/README.md index 32d6bb5..fc7ad49 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ supporting compression and decompression of the following formats: * [createDecompressor()](#createdecompressor) * [Inconsistencies](#inconsistencies) * [Install](#install) +* [Tests](#tests) * [License](#license) * [More](#more) @@ -154,6 +155,21 @@ The recommended way to install this library is [through composer](https://getcom $ composer require clue/zlib-react:~0.1.0 ``` +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://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 927a178..7776226 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "clue/stream-filter": "~1.3" }, "require-dev": { - "react/event-loop": "~0.4.0|~0.3.0" + "react/event-loop": "~0.4.0|~0.3.0", + "phpunit/phpunit": "^4.8" }, "suggest": { "ext-zlib": "Requires ext-zlib extension" From c47c27aa47f1a40629db04414090e2d9a2fe5592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 18 Aug 2017 13:41:32 +0200 Subject: [PATCH 2/2] Forward compatibility with PHPUnit v5 --- composer.json | 2 +- tests/bootstrap.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7776226..ded4392 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "react/event-loop": "~0.4.0|~0.3.0", - "phpunit/phpunit": "^4.8" + "phpunit/phpunit": "^5.0 || ^4.8" }, "suggest": { "ext-zlib": "Requires ext-zlib extension" diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 73b4462..05c2338 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -42,7 +42,7 @@ protected function expectCallableNever() */ protected function createCallableMock() { - return $this->getMock('CallableStub'); + return $this->getMockBuilder('CallableStub')->getMock(); } }