[php-phpunit-PHPUnit-MockObject/f20] more change from upstream for generator

Remi Collet remi at fedoraproject.org
Thu Jul 17 05:43:47 UTC 2014


commit a0759241b25bec2bf01b41a4a5b578bdde000207
Author: Remi Collet <rcollet at redhat.com>
Date:   Thu Jul 17 07:44:02 2014 +0200

    more change from upstream for generator

 PHPUnit_MockObject-upstream.patch   |   36 +++++++++++++++++++++++++++++-----
 php-phpunit-PHPUnit-MockObject.spec |    9 ++++++-
 2 files changed, 37 insertions(+), 8 deletions(-)
---
diff --git a/PHPUnit_MockObject-upstream.patch b/PHPUnit_MockObject-upstream.patch
index bb06dad..92b0211 100644
--- a/PHPUnit_MockObject-upstream.patch
+++ b/PHPUnit_MockObject-upstream.patch
@@ -1,7 +1,7 @@
-diff -up PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.old PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php
---- PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.old	2014-05-30 16:23:41.970022863 +0200
-+++ PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php	2014-05-30 16:23:56.227089175 +0200
-@@ -240,11 +240,14 @@ class PHPUnit_Framework_MockObject_Gener
+diff -up PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.upstream PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php
+--- PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.upstream	2013-01-13 11:25:05.000000000 +0100
++++ PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php	2014-07-17 07:35:27.673415009 +0200
+@@ -240,17 +240,37 @@ class PHPUnit_Framework_MockObject_Gener
                  $object = $class->newInstanceArgs($arguments);
              }
          } else {
@@ -11,9 +11,13 @@ diff -up PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.old
 -              sprintf('O:%d:"%s":0:{}', strlen($className), $className)
 -            );
 +            $class = new ReflectionClass($className);
-+            if ($class->isInternal() || version_compare(PHP_VERSION, '5.4.0', '<')) {
++            if (self::isInternalClass($class) || version_compare(PHP_VERSION, '5.4.0', '<')) {
 +                $object = unserialize(
-+                    sprintf('O:%d:"%s":0:{}', strlen($className), $className)
++                    sprintf('%s:%d:"%s":0:{}',
++                        (version_compare(PHP_VERSION, '5.4', '>') && $class->implementsInterface("Serializable") ? "C" : "O"),
++                        strlen($className),
++                        $className
++                    )
 +                );
 +            } else {
 +                $object = $class->newInstanceWithoutConstructor();
@@ -21,3 +25,23 @@ diff -up PHPUnit_MockObject-1.2.3/PHPUnit/Framework/MockObject/Generator.php.old
          }
  
          return $object;
+     }
+ 
+-    /**
++    private static function isInternalClass(ReflectionClass $class)
++    {
++        while ($class) {
++            if ($class->isInternal()) {
++                return true;
++            }
++
++            $class = $class->getParentClass();
++        }
++
++        return false;
++    }
++
++      /**
+      * Returns a mock object for the specified abstract class with all abstract
+      * methods of the class mocked. Concrete methods to mock can be specified with
+      * the last parameter
diff --git a/php-phpunit-PHPUnit-MockObject.spec b/php-phpunit-PHPUnit-MockObject.spec
index e31cf75..c081070 100644
--- a/php-phpunit-PHPUnit-MockObject.spec
+++ b/php-phpunit-PHPUnit-MockObject.spec
@@ -4,7 +4,7 @@
 
 Name:           php-phpunit-PHPUnit-MockObject
 Version:        1.2.3
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Mock Object library for PHPUnit
 
 Group:          Development/Libraries
@@ -15,6 +15,8 @@ Source0:        http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz
 # Upstream fix for PHP 5.4.29 and 5.5.13
 # https://github.com/sebastianbergmann/phpunit-mock-objects/commit/1c68f1338f1940deb8265428bb2a7cbc5bc074b5
 # https://github.com/sebastianbergmann/phpunit-mock-objects/commit/ba8784d88ff4cc52cf9424d7f7c631ccd867019c
+# https://github.com/sebastianbergmann/phpunit-mock-objects/commit/4a338e464a94d3e5a48ae28292e98e9b4e3ac898
+# https://github.com/sebastianbergmann/phpunit-mock-objects/commit/a7dfbd7aa63570a789e0bfaec15046071b33483a
 Patch0:         %{pear_name}-upstream.patch
 
 BuildArch:      noarch
@@ -42,7 +44,7 @@ Mock Object library for PHPUnit
 %prep
 %setup -q -c
 cd %{pear_name}-%{version}
-%patch0 -p1
+%patch0 -p1 -b .upstream
 sed -e '/Generator.php/s/md5sum="[^"]*"//' \
     ../package.xml >%{name}.xml
 touch -r ../package.xml %{name}.xml
@@ -83,6 +85,9 @@ fi
 
 
 %changelog
+* Thu Jul 17 2014 Remi Collet <remi at fedoraproject.org> - 1.2.3-5
+- more change from upstream for generator
+
 * Fri May 30 2014 Remi Collet <remi at fedoraproject.org> - 1.2.3-4
 - upstream fix for latest PHP (#1103223)
 


More information about the scm-commits mailing list