RunnerVersion.php 626 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\TestTools\PhpUnitCompatibility;
  3. use PHPUnit\Runner\Version;
  4. /**
  5. * Helper class to determine information about running PHPUnit version.
  6. *
  7. * This class contains static methods only and is not meant to be instantiated.
  8. */
  9. final class RunnerVersion {
  10. /**
  11. * This class should not be instantiated.
  12. */
  13. private function __construct() {
  14. }
  15. /**
  16. * Returns the major version of the PHPUnit runner being used.
  17. *
  18. * @return int
  19. * The major version of the PHPUnit runner being used.
  20. */
  21. public static function getMajor() {
  22. return (int) explode('.', Version::id())[0];
  23. }
  24. }