Skip to content

Commit ed3d7fd

Browse files
committed
attempting to fix build
1 parent 95c1307 commit ed3d7fd

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ before_script:
5555
- |
5656
case "$TRAVIS_PHP_VERSION" in
5757
5.6|5.5|5.4|5.3)
58+
echo "Using PHPUnit 4.x"
5859
composer global require "phpunit/phpunit:^4"
5960
;;
6061
5.2)
6162
;;
6263
*)
63-
composer global require "phpunit/phpunit:6"
64+
echo "Using PHPUnit 6.x"
65+
composer global require "phpunit/phpunit:^6"
6466
;;
6567
esac
6668
- |

tests/phpunit/bootstrap.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ function _manually_load_plugin() {
3030
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
3131
}
3232

33-
// Core started including their own phpunit6-compat, so we should use that if we can.
34-
if ( ! file_exists( $test_root . '/includes/phpunit6-compat.php' ) ) {
35-
// WordPress versions before 4.8 will be incompatible with newer PHPUnit versions.
36-
if ( version_compare( getenv( 'WP_VERSION' ), '4.8', '<' ) && class_exists( 'PHPUnit\Runner\Version' ) ) {
37-
require_once dirname( __FILE__ ) . '/phpunit6-compat.php';
38-
}
33+
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
34+
require_once dirname( __FILE__ ) . '/phpunit6-compat.php';
3935
}
4036

4137
require $test_root . '/includes/bootstrap.php';

tests/phpunit/phpunit6-compat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {
3+
if ( class_exists( 'PHPUnit\Runner\Version' ) && !(class_exists('PHPUnit_Framework_TestCase')) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {
44

55
class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' );
66
class_alias( 'PHPUnit\Framework\Exception', 'PHPUnit_Framework_Exception' );
@@ -15,10 +15,10 @@ class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_
1515
class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' );
1616
class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );
1717

18-
class PHPUnit_Util_Test extends PHPUnit\Util\Test {
18+
class PHPUnit_Util_Test {
1919

2020
public static function getTickets( $className, $methodName ) {
21-
$annotations = self::parseTestMethodAnnotations( $className, $methodName );
21+
$annotations = PHPUnit\Util\Test::parseTestMethodAnnotations( $className, $methodName );
2222

2323
$tickets = array();
2424

0 commit comments

Comments
 (0)