[php-phpunit-PHPUnit/f16] fix compatibility with some recent extensions: File_Iterator PHP_Invoker, PHP_Timer, PHP_Tokenstrea

Remi Collet remi at fedoraproject.org
Wed Oct 24 06:26:11 UTC 2012


commit ae69e72b38abf143585449d28d92fb306317e14d
Author: Remi Collet <remi at fedoraproject.org>
Date:   Wed Oct 24 07:39:12 2012 +0200

    fix compatibility with some recent extensions:  File_Iterator
    PHP_Invoker, PHP_Timer, PHP_Tokenstream, Text_Template (#869367)

 php-phpunit-PHPUnit.spec |   18 +++++++++++++---
 phpunit-autoload.patch   |   49 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 4 deletions(-)
---
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec
index 1503e10..5f6307e 100644
--- a/php-phpunit-PHPUnit.spec
+++ b/php-phpunit-PHPUnit.spec
@@ -1,10 +1,11 @@
+%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
 %{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
 %global pear_name PHPUnit
 %global channel pear.phpunit.de
 
 Name:           php-phpunit-PHPUnit
 Version:        3.6.12
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        The PHP Unit Testing framework
 
 Group:          Development/Libraries
@@ -12,6 +13,8 @@ License:        BSD
 URL:            http://www.phpunit.de
 Source0:        http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz
 
+Patch0:         phpunit-autoload.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -51,8 +54,11 @@ 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 .compat
+
+sed -e '/GlobalState.php/s/md5sum.*name/name/' \
+    ../package.xml >%{name}.xml
 
 
 %build
@@ -68,7 +74,7 @@ cd %{pear_name}-%{version}
 %{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
 
 # Clean up unnecessary files
-rm -rf %{buildroot}%{pear_phpdir}/.??*
+rm -rf %{buildroot}%{pear_metadir}/.??*
 
 # Install XML package description
 install -d %{buildroot}%{pear_xmldir}
@@ -105,6 +111,10 @@ fi
 
 
 %changelog
+* Tue Oct 24 2012 Remi Collet <remi at fedoraproject.org> - 3.6.12-2
+- fix compatibility with some recent extensions:  File_Iterator
+  PHP_Invoker, PHP_Timer, PHP_Tokenstream, Text_Template (#869367)
+
 * Sat Aug 04 2012 Remi Collet <remi at fedoraproject.org> - 3.6.12-1
 - Version 3.6.12 (stable) - API 3.6.0 (stable)
 
diff --git a/phpunit-autoload.patch b/phpunit-autoload.patch
new file mode 100644
index 0000000..ca277c8
--- /dev/null
+++ b/phpunit-autoload.patch
@@ -0,0 +1,49 @@
+diff -up PHPUnit-3.6.12/PHPUnit/Util/GlobalState.php.orig PHPUnit-3.6.12/PHPUnit/Util/GlobalState.php
+--- PHPUnit-3.6.12/PHPUnit/Util/GlobalState.php.orig	2012-10-24 07:28:29.000000000 +0200
++++ PHPUnit-3.6.12/PHPUnit/Util/GlobalState.php	2012-10-24 07:28:50.000000000 +0200
+@@ -375,14 +375,39 @@ class PHPUnit_Util_GlobalState
+         if (self::$phpunitFiles === NULL) {
+             self::$phpunitFiles = array_merge(
+               phpunit_autoload(),
+-              phpunit_mockobject_autoload(),
+-              file_iterator_autoload(),
+-              php_codecoverage_autoload(),
+-              php_timer_autoload(),
+-              php_tokenstream_autoload(),
+-              text_template_autoload()
++              phpunit_mockobject_autoload()
+             );
+ 
++            if (function_exists('file_iterator_autoload')) {
++                self::$phpunitFiles = array_merge(
++                  self::$phpunitFiles, file_iterator_autoload()
++                );
++            }
++
++            if (function_exists('php_codecoverage_autoload')) {
++                self::$phpunitFiles = array_merge(
++                  self::$phpunitFiles, php_codecoverage_autoload()
++                );
++            }
++
++            if (function_exists('php_timer_autoload')) {
++                self::$phpunitFiles = array_merge(
++                  self::$phpunitFiles, php_timer_autoload()
++                );
++            }
++
++            if (function_exists('php_tokenstream_autoload')) {
++                self::$phpunitFiles = array_merge(
++                  self::$phpunitFiles, php_tokenstream_autoload()
++                );
++            }
++
++            if (function_exists('text_template_autoload')) {
++                self::$phpunitFiles = array_merge(
++                  self::$phpunitFiles, text_template_autoload()
++                );
++            }
++
+             if (function_exists('phpunit_dbunit_autoload')) {
+                 self::$phpunitFiles = array_merge(
+                   self::$phpunitFiles, phpunit_dbunit_autoload()


More information about the scm-commits mailing list