From: jenkins-bot Date: Fri, 13 Apr 2018 17:59:57 +0000 (+0000) Subject: Merge "Allow PHPUnit 6 optionally in require-dev" X-Git-Tag: 1.31.0-rc.0~82 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=eb188bef3c3b04aafe4e8283875786b03c01e5e3;hp=93a531f935febc0d2f1c143ddef815a5ccf1a87b;p=lhc%2Fweb%2Fwiklou.git Merge "Allow PHPUnit 6 optionally in require-dev" --- diff --git a/composer.json b/composer.json index 9cb4ba9202..321a941353 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "monolog/monolog": "~1.22.1", "nikic/php-parser": "3.1.3", "nmred/kafka-php": "0.1.5", - "phpunit/phpunit": "4.8.36", + "phpunit/phpunit": "4.8.36 || ^6.5", "psy/psysh": "0.8.11", "wikimedia/avro": "1.8.0", "wikimedia/testing-access-wrapper": "~1.0", diff --git a/tests/phan/config.php b/tests/phan/config.php index 84132b9682..71ebd6f4d0 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -38,6 +38,10 @@ return [ function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ], class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ], class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ], + // Per composer.json, PHPUnit 6 is used for PHP 7.0+, PHPUnit 4 otherwise. + // Load the interface for the version of PHPUnit that isn't installed. + // Phan only supports PHP 7.0+ (and not HHVM), so we only need to stub PHPUnit 4. + class_exists( PHPUnit_TextUI_Command::class ) ? [] : [ 'tests/phan/stubs/phpunit4.php' ], [ 'maintenance/7zip.inc', 'maintenance/backup.inc', diff --git a/tests/phan/stubs/phpunit4.php b/tests/phan/stubs/phpunit4.php new file mode 100644 index 0000000000..e5e88e6bab --- /dev/null +++ b/tests/phan/stubs/phpunit4.php @@ -0,0 +1,11 @@ +hasOption( 'with-phpunitclass' ) ) { $phpUnitClass = $this->getOption( 'with-phpunitclass' );