diff --git a/.travis.yml b/.travis.yml index 402a996..1c59030 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,26 @@ language: php -php: -# - 5.3 # requires old distro, see below - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 -# - hhvm # requires legacy phpunit & ignore errors, see below - # lock distro so new future defaults will not break the build dist: trusty -matrix: +jobs: include: - php: 5.3 dist: precise - - php: hhvm - install: composer require phpunit/phpunit:^5 --dev --no-interaction + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4 + - php: hhvm-3.18 allow_failures: - - php: hhvm - -sudo: false + - php: hhvm-3.18 install: - composer install --no-interaction script: - - ./vendor/bin/phpunit --coverage-text + - vendor/bin/phpunit --coverage-text diff --git a/composer.json b/composer.json index a8f4a43..ae9c39f 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,6 @@ "psr-4": { "React\\Tests\\Cache\\": "tests/" } }, "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d02182f..0e947b8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,6 @@ - + ./tests/ diff --git a/tests/ArrayCacheTest.php b/tests/ArrayCacheTest.php index 3b5bd8c..420d45f 100644 --- a/tests/ArrayCacheTest.php +++ b/tests/ArrayCacheTest.php @@ -11,7 +11,10 @@ class ArrayCacheTest extends TestCase */ private $cache; - public function setUp() + /** + * @before + */ + public function setUpArrayCache() { $this->cache = new ArrayCache(); } diff --git a/tests/CallableStub.php b/tests/CallableStub.php deleted file mode 100644 index 2f547cd..0000000 --- a/tests/CallableStub.php +++ /dev/null @@ -1,10 +0,0 @@ -getMockBuilder('React\Tests\Cache\CallableStub')->getMock(); + if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) { + // PHPUnit 9+ + return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock(); + } else { + // legacy PHPUnit 4 - PHPUnit 9 + return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); + } } }