[php-phpunit-PHPUnit/el6] - disable colors when output is not a tty - define date.timezone to avoid warning - Update to 3.7.34
Remi Collet
remi at fedoraproject.org
Wed Nov 12 15:10:59 UTC 2014
commit d4716ef2b5089c835721a7dafbde17ee2b239766
Author: Remi Collet <remi at fedoraproject.org>
Date: Wed Nov 12 16:05:18 2014 +0100
- disable colors when output is not a tty
- define date.timezone to avoid warning
- Update to 3.7.34
(cherry picked from commit 90fb02081fb82d83069ece8cc3a4514e0d211332)
.gitignore | 3 +++
PHPUnit-rpm.patch | 36 ++++++++++++++++++++++++++++++++++++
php-phpunit-PHPUnit.spec | 24 ++++++++++++++++++++----
sources | 2 +-
4 files changed, 60 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f08a36d..e214faa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,6 @@ package*.xml
/PHPUnit-3.7.27.tgz
/PHPUnit-3.7.28.tgz
/PHPUnit-3.7.29.tgz
+/PHPUnit-3.7.30.tgz
+/PHPUnit-3.7.31.tgz
+/PHPUnit-3.7.34.tgz
diff --git a/PHPUnit-rpm.patch b/PHPUnit-rpm.patch
new file mode 100644
index 0000000..f643705
--- /dev/null
+++ b/PHPUnit-rpm.patch
@@ -0,0 +1,36 @@
+diff -up PHPUnit-3.7.34/phpunit.php.rpm PHPUnit-3.7.34/phpunit.php
+--- PHPUnit-3.7.34/phpunit.php.rpm 2014-11-12 15:23:22.178115346 +0100
++++ PHPUnit-3.7.34/phpunit.php 2014-11-12 15:23:32.738157913 +0100
+@@ -35,6 +35,10 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++if (!ini_get('date.timezone')) {
++ ini_set('date.timezone', 'UTC');
++}
++
+ define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');
+
+ if (strpos('@php_bin@', '@php_bin') === 0) {
+diff -up PHPUnit-3.7.34/PHPUnit/TextUI/Command.php.rpm PHPUnit-3.7.34/PHPUnit/TextUI/Command.php
+--- PHPUnit-3.7.34/PHPUnit/TextUI/Command.php.rpm 2014-11-12 15:22:15.920848253 +0100
++++ PHPUnit-3.7.34/PHPUnit/TextUI/Command.php 2014-11-12 15:26:21.548838470 +0100
+@@ -250,6 +250,7 @@ class PHPUnit_TextUI_Command
+ foreach ($this->options[0] as $option) {
+ switch ($option[0]) {
+ case '--colors': {
++ if (function_exists('posix_isatty') && @posix_isatty(STDOUT))
+ $this->arguments['colors'] = TRUE;
+ }
+ break;
+diff -up PHPUnit-3.7.34/PHPUnit/Util/Configuration.php.rpm PHPUnit-3.7.34/PHPUnit/Util/Configuration.php
+--- PHPUnit-3.7.34/PHPUnit/Util/Configuration.php.rpm 2014-11-12 15:22:29.008901029 +0100
++++ PHPUnit-3.7.34/PHPUnit/Util/Configuration.php 2014-11-12 15:26:28.433866230 +0100
+@@ -582,6 +582,7 @@ class PHPUnit_Util_Configuration
+ }
+
+ if ($root->hasAttribute('colors')) {
++ if (function_exists('posix_isatty') && @posix_isatty(STDOUT))
+ $result['colors'] = $this->getBoolean(
+ (string)$root->getAttribute('colors'), FALSE
+ );
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec
index d6a0f85..47aa05e 100644
--- a/php-phpunit-PHPUnit.spec
+++ b/php-phpunit-PHPUnit.spec
@@ -14,8 +14,8 @@
%global pear_channel pear.phpunit.de
Name: php-phpunit-PHPUnit
-Version: 3.7.29
-Release: 1%{?dist}
+Version: 3.7.34
+Release: 2%{?dist}
Summary: The PHP Unit Testing framework
Group: Development/Libraries
@@ -23,6 +23,11 @@ License: BSD
URL: http://www.phpunit.de
Source0: http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz
+# Backported from PHPUnit 4.4
+# disable colors when output is not a tty
+# define date.timezone to avoid warning
+Patch0: %{pear_name}-rpm.patch
+
BuildArch: noarch
BuildRequires: php(language) >= 5.3.3
BuildRequires: php-pear(PEAR) >= 1.9.4
@@ -75,8 +80,14 @@ for the creation, execution and analysis of Unit Tests.
%prep
%setup -qc
cd %{pear_name}-%{version}
-# package.xml is V2
-mv ../package.xml %{name}.xml
+
+%patch0 -p1 -b .rpm
+# Drop checksum for patched files
+sed -e '/phpunit.php/s/md5sum="[^"]*"//' \
+ -e '/Command.php/s/md5sum="[^"]*"//' \
+ -e '/Configuration.php/s/md5sum="[^"]*"//' \
+ ../package.xml >%{name}.xml
+touch -r ../package.xml %{name}.xml
%build
@@ -123,6 +134,11 @@ fi
%changelog
+* Wed Nov 12 2014 Remi Collet <remi at fedoraproject.org> - 3.7.34-2
+- disable colors when output is not a tty
+- define date.timezone to avoid warning
+- Update to 3.7.34
+
* Wed Jan 15 2014 Remi Collet <remi at fedoraproject.org> - 3.7.29-1
- Update to 3.7.29 (stable)
diff --git a/sources b/sources
index c15722b..7a7cbef 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-52661ad88bf1e0b2f9d4ae3d9dfe4560 PHPUnit-3.7.29.tgz
+7cd54f9ebcbed32692620f0f431838f7 PHPUnit-3.7.34.tgz
More information about the scm-commits
mailing list