class PHPUnit_Runner_Version

This class defines the current version of PHPUnit.

@package PHPUnit @subpackage Runner @author Sebastian Bergmann <sebastian@phpunit.de> @copyright 2001-2013 Sebastian Bergmann <sebastian@phpunit.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License @link http://www.phpunit.de/ @since Class available since Release 2.0.0

Hierarchy

Expanded class hierarchy of PHPUnit_Runner_Version

File

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

View source
class PHPUnit_Runner_Version {
  const VERSION = '3.7.21';
  protected static $version;

  /**
   * Returns the current version of PHPUnit.
   *
   * @return string
   */
  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;
  }

  /**
   * @return string
   */
  public static function getVersionString() {
    return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann.';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PHPUnit_Runner_Version::$version protected static property
PHPUnit_Runner_Version::getVersionString public static function
PHPUnit_Runner_Version::id public static function Returns the current version of PHPUnit.
PHPUnit_Runner_Version::VERSION constant