Skip to content

Commit

Permalink
Merge branch '5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 27, 2015
2 parents c970b9e + 6ec7b8e commit b3db8bc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog-5.0.md
Expand Up @@ -9,6 +9,7 @@ All notable changes of the PHPUnit 5.0 release series are documented in this fil
* Implemented [#1604](https://github.com/sebastianbergmann/phpunit/issues/1604): A `@small` test should be marked as risky when it executes code that performs I/O operations
* Implemented [#1656](https://github.com/sebastianbergmann/phpunit/issues/1656): Allow sorting test failures in reverse
* Merged [#1753](https://github.com/sebastianbergmann/phpunit/issues/1753): Added the `assertFinite()`, `assertInfinite()` and `assertNan()` assertions
* Merged [#1876](https://github.com/sebastianbergmann/phpunit/issues/1876): Added the `--atleast-version` commandline option
* Implemented [#1780](https://github.com/sebastianbergmann/phpunit/issues/1780): Support for deep-cloning of results passed between tests using `@depends`
* Implemented [#1821](https://github.com/sebastianbergmann/phpunit/issues/1821): Expectations on mock objects passed via `@depends` are now also evaluated for the depending test
* Added `--whitelist` commandline option to configure a whitelist for code coverage analysis
Expand Down
9 changes: 9 additions & 0 deletions src/TextUI/Command.php
Expand Up @@ -36,6 +36,7 @@ class PHPUnit_TextUI_Command
* @var array
*/
protected $longOptions = [
'atleast-version=' => null,
'bootstrap=' => null,
'colors==' => null,
'columns=' => null,
Expand Down Expand Up @@ -456,6 +457,13 @@ protected function handleArguments(array $argv)
$this->arguments['verbose'] = true;
break;

case '--atleast-version':
exit (version_compare(PHPUnit_Runner_Version::id(), $option[1], '>=')
? PHPUnit_TextUI_TestRunner::SUCCESS_EXIT
: PHPUnit_TextUI_TestRunner::FAILURE_EXIT
);
break;

case '--version':
$this->printVersionString();
exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
Expand Down Expand Up @@ -956,6 +964,7 @@ protected function showHelp()
-h|--help Prints this usage information.
--version Prints the version and exits.
--atleast-version <min> Checks that version is greater than min and exits.
EOT;

Expand Down
1 change: 1 addition & 0 deletions tests/TextUI/help.phpt
Expand Up @@ -91,3 +91,4 @@ Miscellaneous Options:

-h|--help Prints this usage information.
--version Prints the version and exits.
--atleast-version <min> Checks that version is greater than min and exits.
1 change: 1 addition & 0 deletions tests/TextUI/help2.phpt
Expand Up @@ -92,3 +92,4 @@ Miscellaneous Options:

-h|--help Prints this usage information.
--version Prints the version and exits.
--atleast-version <min> Checks that version is greater than min and exits.

0 comments on commit b3db8bc

Please sign in to comment.