bug #23952 [PhpUnitBridge] install PHPUnit 6 on PHP 7.2 (xabbuh)

This PR was merged into the 3.3 branch.

Discussion
----------

[PhpUnitBridge] install PHPUnit 6 on PHP 7.2

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23943
| License       | MIT
| Doc PR        |

Commits
-------

30336ead94 install PHPUnit 6 on PHP 7.2
This commit is contained in:
Fabien Potencier 2017-08-28 04:32:48 -07:00
commit faa83282bc
2 changed files with 16 additions and 2 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
3.4.0
-----
* PHPUnit 6 is installed when using PHP 7.2+
3.3.0
-----

View File

@ -15,8 +15,17 @@
error_reporting(-1);
// PHPUnit 4.8 does not support PHP 7, while 5.1 requires PHP 5.6+
$PHPUNIT_VERSION = PHP_VERSION_ID >= 50600 ? getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7' : '4.8';
if (PHP_VERSION_ID >= 70200) {
// PHPUnit 6 is required for PHP 7.2+
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '6.3';
} elseif (PHP_VERSION_ID >= 50600) {
// PHPUnit 4 does not support PHP 7
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7';
} else {
// PHPUnit 5.1 requires PHP 5.6+
$PHPUNIT_VERSION = '4.8';
}
$oldPwd = getcwd();
$PHPUNIT_DIR = getenv('SYMFONY_PHPUNIT_DIR') ?: (__DIR__.'/.phpunit');
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';