In order to support PHPUnit testing on PHP 7.2, PHPUnit is upgraded to version 6 when composer install is run on PHP 7.2. This will make changes to your composer.lock file. If your production server is not PHP 7.2 then it is not recommended to use PHP 7.2 in your development environment.
Drupal 8 implements a compatibility layer to make the transition from PHPUnit 4 to 6. Developers should not have to change any tests that extend from the Drupal test base classes. However, if code that is deprecated in PHP 7.2 is used, for example the each()
function, then that will have to be changed.
Note that for Drupal 8.6.x, this change is expanded to use PHPUnit 6 for PHP versions 7.0 and above: https://www.drupal.org/node/2957906