Skip to content

Run tests on PHPUnit 9, simplify test matrix and clean up test suite (promise-2.x) #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 1 addition & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Promise Test Suite">
<directory>./tests/</directory>
Expand Down
8 changes: 7 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down