diff --git a/.travis.yml b/.travis.yml index 03b7ecb..290df75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,25 @@ language: php php: - - 5.3 +# - 5.3 # requires old distro, see below - 5.4 - 5.5 - 5.6 - 7 - hhvm +# lock distro so new future defaults will not break the build +dist: trusty + +matrix: + include: + - php: 5.3 + dist: precise + +sudo: false + install: - - composer install --prefer-source --no-interaction + - composer install --no-interaction script: - ./vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index c426e21..03f5eda 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ provide alternate implementations. * [Fallback get](#fallback-get) * [Fallback-get-and-set](#fallback-get-and-set) * [Install](#install) +* [Tests](#tests) * [License](#license) ## Usage @@ -150,6 +151,21 @@ $ composer require "react/cache:~0.4.0|~0.3.0" More details and upgrade guides can be found in the [CHANGELOG](CHANGELOG.md). +## 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, see [LICENSE file](LICENSE). diff --git a/composer.json b/composer.json index 854099f..9a8bb33 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,6 @@ "psr-4": { "React\\Tests\\Cache\\": "tests/" } }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 93a04fb..aa449f2 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,9 @@ namespace React\Tests\Cache; -class TestCase extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase as BaseTestCase; + +class TestCase extends BaseTestCase { protected function expectCallableExactly($amount) { @@ -36,6 +38,6 @@ protected function expectCallableNever() protected function createCallableMock() { - return $this->getMock('React\Tests\Cache\CallableStub'); + return $this->getMockBuilder('React\Tests\Cache\CallableStub')->getMock(); } }