You are here

protected function PHPUnit_TextUI_Command::handleVersionCheck in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/TextUI/Command.php \PHPUnit_TextUI_Command::handleVersionCheck()

@since Method available since Release 4.8.0

1 call to PHPUnit_TextUI_Command::handleVersionCheck()
PHPUnit_TextUI_Command::handleArguments in vendor/phpunit/phpunit/src/TextUI/Command.php
Handles the command-line arguments.

File

vendor/phpunit/phpunit/src/TextUI/Command.php, line 852

Class

PHPUnit_TextUI_Command
A TestRunner for the Command Line Interface (CLI) PHP SAPI Module.

Code

protected function handleVersionCheck() {
  $this
    ->printVersionString();
  $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit');
  $isOutdated = version_compare($latestVersion, PHPUnit_Runner_Version::id(), '>');
  if ($isOutdated) {
    print "You are not using the latest version of PHPUnit.\n";
    print 'Use "phpunit --self-update" to install PHPUnit ' . $latestVersion . "\n";
  }
  else {
    print "You are using the latest version of PHPUnit.\n";
  }
  exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
}