Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 27c6f85

Browse files
committed
Ensure tests run on lowest dependencies
PHPUnit 5.7 does not namespace the ExpectationFailedException, so we need to conditionally alias it to the non-namespaced version for tests to run.
1 parent 715c7b0 commit 27c6f85

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ matrix:
2525
env:
2626
- DEPS=locked
2727
- TEST_COVERAGE=true
28-
- LEGACY_DEPS="phpunit/phpunit"
28+
- LEGACY_DEPS="phpunit/phpunit zendframework/zend-code"
2929
- php: 5.6
3030
env:
3131
- DEPS=latest
@@ -36,7 +36,7 @@ matrix:
3636
env:
3737
- DEPS=locked
3838
- CS_CHECK=true
39-
- LEGACY_DEPS="phpunit/phpunit"
39+
- LEGACY_DEPS="phpunit/phpunit zendframework/zend-code"
4040
- php: 7
4141
env:
4242
- DEPS=latest

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"ZendTest\\XmlRpc\\": "test/"
1818
},
1919
"files": [
20+
"test/autoload.php",
2021
"test/TestAsset/functions.php"
2122
]
2223
},

test/autoload.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* @see https://github.com/zendframework/zend-xmlrpc for the canonical source repository
4+
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
5+
* @license https://github.com/zendframework/zend-xmlrpc/blob/master/LICENSE.md New BSD License
6+
*/
7+
8+
/**
9+
* @todo This file may be removed once we drop support for PHP 5.
10+
*/
11+
if (! class_exists(PHPUnit\Framework\ExpectationFailedException::class)) {
12+
class_alias(
13+
PHPUnit_Framework_ExpectationFailedException::class,
14+
PHPUnit\Framework\ExpectationFailedException::class,
15+
true
16+
);
17+
}

0 commit comments

Comments
 (0)