summaryrefslogtreecommitdiffstats
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
parent5e6af93f7dd4b1ad5377ff83dd77990de019d304 (diff)
php-phpunit-PHPUnit: add --atleast-version command option, backported from 5.0
-rw-r--r--php-phpunit-PHPUnit.spec9
-rw-r--r--phpunit-atleast.patch56
2 files changed, 64 insertions, 1 deletions
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec
index 9dcad21..91ceaa3 100644
--- a/php-phpunit-PHPUnit.spec
+++ b/php-phpunit-PHPUnit.spec
@@ -20,7 +20,7 @@
Name: php-phpunit-PHPUnit
Version: %{major}.%{minor}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The PHP Unit Testing framework
Group: Development/Libraries
@@ -33,6 +33,8 @@ Source1: Autoload.php.in
# Fix command for autoload
Patch0: %{gh_project}-rpm.patch
+# add --atleast-version option, backported from 5.0
+Patch1: %{gh_project}-atleast.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -152,6 +154,8 @@ for the creation, execution and analysis of Unit Tests.
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0 -b .rpm
+%patch1 -p1 -b .atleast
+rm src/TextUI/Command.php.atleast
# Restore PSR-0 tree
mv src PHPUnit
@@ -202,6 +206,9 @@ fi
%changelog
+* Sun Sep 27 2015 Remi Collet <remi@fedoraproject.org> - 4.8.9-2
+- add --atleast-version command option, backported from 5.0
+
* Mon Sep 21 2015 Remi Collet <remi@fedoraproject.org> - 4.8.9-1
- Update to 4.8.9
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.