public static function PHPUnit_Runner_Version::id

Returns the current version of PHPUnit.

Return value

string

4 calls to PHPUnit_Runner_Version::id()
NativePhpunitTask::init in drupal/core/vendor/doctrine/common/tests/NativePhpunitTask.php
PHPUnit_Framework_TestCase::checkRequirements in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php
@since Method available since Release 3.6.0
PHPUnit_Runner_Version::getVersionString in drupal/core/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php
PHPUnit_TextUI_TestRunner::doRun in drupal/core/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php, line 67

Class

PHPUnit_Runner_Version
This class defines the current version of PHPUnit.

Code

public static function id() {
  if (self::$version === NULL) {
    self::$version = self::VERSION;
    if (is_dir(dirname(dirname(__DIR__)) . '/.git')) {
      $dir = getcwd();
      chdir(__DIR__);
      $version = exec('git describe --tags 2>&1', $output, $returnCode);
      chdir($dir);
      if ($version && $returnCode === 0) {
        if (count(explode('.', self::VERSION)) == 3) {
          self::$version = $version;
        }
        else {
          $version = explode('-', $version);
          self::$version = self::VERSION . '-' . $version[2];
        }
      }
      else {
        self::$version = self::VERSION . '-dev';
      }
    }
  }
  return self::$version;
}