summaryrefslogtreecommitdiffstats
path: root/phpunit-atleast.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-09-27 11:34:58 +0200
committerRemi Collet <fedora@famillecollet.com>2015-09-27 11:34:58 +0200
commit803d9b4181778b474f28c0eb9fa7a2e4761f7a23 (patch)
treeb362b2459ebd2e916e89fad9187c57fd988fb9aa /phpunit-atleast.patch
parent5e6af93f7dd4b1ad5377ff83dd77990de019d304 (diff)
php-phpunit-PHPUnit: add --atleast-version command option, backported from 5.0
Diffstat (limited to 'phpunit-atleast.patch')
-rw-r--r--phpunit-atleast.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/phpunit-atleast.patch b/phpunit-atleast.patch
new file mode 100644
index 0000000..5f2ea0a
--- /dev/null
+++ b/phpunit-atleast.patch
@@ -0,0 +1,56 @@
+add --atleast-version command option, backported from 5.0
+
+See https://github.com/sebastianbergmann/phpunit/pull/1876
+
+https://github.com/sebastianbergmann/phpunit/commit/0f335c6908f924042ea3ac9e2c110aa6dce7800e
+https://github.com/sebastianbergmann/phpunit/commit/e3b3f36dab3a896f8def75e6ed5789ca40e02872
+
+diff -up ./src/TextUI/Command.php.atleast ./src/TextUI/Command.php
+--- ./src/TextUI/Command.php.atleast 2015-09-20 14:56:44.000000000 +0200
++++ ./src/TextUI/Command.php 2015-09-27 11:27:03.043289929 +0200
+@@ -34,6 +34,7 @@ class PHPUnit_TextUI_Command
+ * @var array
+ */
+ protected $longOptions = array(
++ 'atleast-version=' => null,
+ 'colors==' => null,
+ 'bootstrap=' => null,
+ 'columns=' => null,
+@@ -437,6 +438,13 @@ class PHPUnit_TextUI_Command
+ $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);
+@@ -948,6 +956,7 @@ 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.
+
+ EOT;
+
+diff -up ./tests/TextUI/help2.phpt.atleast ./tests/TextUI/help2.phpt
+--- ./tests/TextUI/help2.phpt.atleast 2015-09-20 14:56:44.000000000 +0200
++++ ./tests/TextUI/help2.phpt 2015-09-27 11:27:03.043289929 +0200
+@@ -86,3 +86,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.
+diff -up ./tests/TextUI/help.phpt.atleast ./tests/TextUI/help.phpt
+--- ./tests/TextUI/help.phpt.atleast 2015-09-20 14:56:44.000000000 +0200
++++ ./tests/TextUI/help.phpt 2015-09-27 11:27:03.043289929 +0200
+@@ -85,3 +85,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.