diff --git a/.travis.yml b/.travis.yml index da0fcd0d..db571d1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,21 @@ language: php -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly # ignore errors, see below - - hhvm # ignore errors, see below - # lock distro so new future defaults will not break the build dist: trusty -matrix: +jobs: + include: + - 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 - - php: nightly + - php: hhvm-3.18 install: - composer install diff --git a/composer.json b/composer.json index b3e723a7..0c01d6cf 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.36" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3d184322..0b97c746 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,15 +1,6 @@ - + ./tests/ diff --git a/tests/TestCase.php b/tests/TestCase.php index 542629bb..30230a4b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -36,7 +36,13 @@ public function expectCallableNever() public function createCallableMock() { - return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); + if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) { + // PHPUnit 10+ + return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock(); + } else { + // legacy PHPUnit 4 - PHPUnit 9 + return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); + } } public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)