Skip to content

Commit a8ec7b4

Browse files
authored
Merge pull request #174 from SimonFrings/tests-2.x
Run tests on PHPUnit 9, simplify test matrix and clean up test suite (promise-2.x)
2 parents f3cff96 + 66532ac commit a8ec7b4

4 files changed

Lines changed: 21 additions & 27 deletions

File tree

.travis.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
language: php
22

3-
php:
4-
- 5.4
5-
- 5.5
6-
- 5.6
7-
- 7.0
8-
- 7.1
9-
- 7.2
10-
- 7.3
11-
- 7.4
12-
- nightly # ignore errors, see below
13-
- hhvm # ignore errors, see below
14-
153
# lock distro so new future defaults will not break the build
164
dist: trusty
175

18-
matrix:
6+
jobs:
7+
include:
8+
- php: 5.4
9+
- php: 5.5
10+
- php: 5.6
11+
- php: 7.0
12+
- php: 7.1
13+
- php: 7.2
14+
- php: 7.3
15+
- php: 7.4
16+
- php: hhvm-3.18
1917
allow_failures:
20-
- php: hhvm
21-
- php: nightly
18+
- php: hhvm-3.18
2219

2320
install:
2421
- composer install

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"php": ">=5.4.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36"
12+
"phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.36"
1313
},
1414
"autoload": {
1515
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
bootstrap="vendor/autoload.php"
12-
>
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
134
<testsuites>
145
<testsuite name="Promise Test Suite">
156
<directory>./tests/</directory>

tests/TestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ public function expectCallableNever()
3636

3737
public function createCallableMock()
3838
{
39-
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
39+
if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) {
40+
// PHPUnit 10+
41+
return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock();
42+
} else {
43+
// legacy PHPUnit 4 - PHPUnit 9
44+
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
45+
}
4046
}
4147

4248
public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)

0 commit comments

Comments
 (0)