[pkg-php-pear] Bug#863441: symfony: fix testsuite failures with PHP7.1

Nishanth Aravamudan nish.aravamudan at canonical.com
Fri May 26 21:46:28 UTC 2017


Package: symfony
Version: 2.8.7+dfsg-1.2
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * debian/patches/fix-php-7.1-vardumper-failures: Fix VarDumper and
    VarDumper tests on PHP7.1.  Thanks to Nicolas Grekas
    <nicolas.grekas at gmail.com>.
  * debian/patches/fix-php-7.1-classloader-failures: Fix ClassLoader
    tests with PHP7.1.  Thanks to Nicolas Grekas
    <nicolas.grekas at gmail.com>..
  * debian/patches/fix-php-7.1-filesystem-failures: Fix Filesystem test
    with PHP7.1.


Thanks for considering the patch.

*** /tmp/tmpnCEGox/symfony_2.8.7+dfsg-1.2ubuntu2.debdiff
diff -Nru symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-classloader-failures symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-classloader-failures
--- symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-classloader-failures	1969-12-31 16:00:00.000000000 -0800
+++ symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-classloader-failures	2017-05-26 11:55:05.000000000 -0700
@@ -0,0 +1,52 @@
+Description: Fix ClassLoader tests with PHP7.1
+Author: Nicolas Grekas <nicolas.grekas at gmail.com>.
+Origin: upstream, https://github.com/symfony/symfony/commit/0f95708a1dea343784f5b7b8533faf4240e0f7da
+Reviewed-by: Nishanth Aravamudan <nish.aravamudan at canonical.com>
+Last-Update: 2017-05-26
+
+--- symfony-2.8.7+dfsg.orig/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php
++++ symfony-2.8.7+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php
+@@ -31,14 +31,14 @@ class ClassCollectionLoaderTest extends
+         $m = $r->getMethod('getOrderedClasses');
+         $m->setAccessible(true);
+ 
+-        $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', array('CTFoo'));
++        $ordered = $m->invoke(null, array('CTFoo'));
+ 
+         $this->assertEquals(
+             array('TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'),
+             array_map(function ($class) { return $class->getName(); }, $ordered)
+         );
+ 
+-        $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', array('CTBar'));
++        $ordered = $m->invoke(null, array('CTBar'));
+ 
+         $this->assertEquals(
+             array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'),
+@@ -62,7 +62,7 @@ class ClassCollectionLoaderTest extends
+         $m = $r->getMethod('getOrderedClasses');
+         $m->setAccessible(true);
+ 
+-        $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
++        $ordered = $m->invoke(null, $classes);
+ 
+         $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
+     }
+@@ -120,7 +120,7 @@ class ClassCollectionLoaderTest extends
+         $m = $r->getMethod('getOrderedClasses');
+         $m->setAccessible(true);
+ 
+-        $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
++        $ordered = $m->invoke(null, $classes);
+ 
+         $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
+     }
+@@ -162,7 +162,7 @@ class ClassCollectionLoaderTest extends
+         $m = $r->getMethod('getOrderedClasses');
+         $m->setAccessible(true);
+ 
+-        $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes);
++        $ordered = $m->invoke(null, $classes);
+ 
+         $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
+     }
diff -Nru symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-filesystem-failures symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-filesystem-failures
--- symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-filesystem-failures	1969-12-31 16:00:00.000000000 -0800
+++ symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-filesystem-failures	2017-05-26 14:30:59.000000000 -0700
@@ -0,0 +1,21 @@
+Description: Fix Filesystem test with PHP7.1
+ PHP7.1 has changed tempnam() to print a notice when falling back to the
+ system temporary directory. This leads to a testcase failure. For
+ reference, PHP bug/feature change is
+ https://bugs.php.net/bug.php?id=69489.
+Author: Nishanth Aravamudan <nish.aravamudan at canonical.com>
+Origin: vendor
+Forwarded: yes, https://github.com/symfony/symfony/pull/22923
+Last-Update: 2017-05-26
+
+--- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
++++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
+@@ -1091,7 +1091,7 @@
+         $scheme = 'file://';
+         $dirname = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'does_not_exist';
+ 
+-        $filename = $this->filesystem->tempnam($dirname, 'bar');
++        $filename = @$this->filesystem->tempnam($dirname, 'bar');
+         $realTempDir = realpath(sys_get_temp_dir());
+         $this->assertStringStartsWith(rtrim($scheme.$realTempDir, DIRECTORY_SEPARATOR), $filename);
+         $this->assertFileExists($filename);
diff -Nru symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-vardumper-failures symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-vardumper-failures
--- symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-vardumper-failures	1969-12-31 16:00:00.000000000 -0800
+++ symfony-2.8.7+dfsg/debian/patches/fix-php-7.1-vardumper-failures	2017-05-26 13:10:57.000000000 -0700
@@ -0,0 +1,46 @@
+Description: Fix VarDumper and VarDumper tests on PHP7.1
+ Part of these fixes are backports from upstream and part of new fixes
+ needed upstream.
+Author: Nicolas Grekas <nicolas.grekas at gmail.com>
+Origin: upstream, https://github.com/symfony/symfony/pull/19379/commits/d422939f6c3ae33435b0208ff363fac9d97ebf6b
+Origin: upstream, https://github.com/symfony/symfony/commit/3672c01e3c7182888a42b74e2864a20e21cfe7f5
+Origin: upstream, https://github.com/symfony/symfony/commit/6ef78ec55317ac473fa045706244ef1f97d4b2de
+Bug: https://github.com/symfony/symfony/pull/19379
+Reviewed-By: Nishanth Aravamudan <nish.aravamudan at canonical.com>
+Last-Update: 2017-05-26
+Applied-Upstream: 2.8.20
+
+--- a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php
++++ b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php
+@@ -291,7 +291,7 @@
+             if (!empty($frame['line'])) {
+                 ob_start();
+                 debug_zval_dump($obj);
+-                self::$hashMask = substr(ob_get_clean(), 17);
++                self::$hashMask = (int) substr(ob_get_clean(), 17);
+             }
+         }
+ 
+--- a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
++++ b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
+@@ -188,7 +188,6 @@
+                 }
+             };'),
+         ));
+-        $line = __LINE__ - 2;
+         $ref = (int) $out;
+ 
+         $data = $cloner->cloneVar($out);
+@@ -261,10 +260,8 @@
+       }
+       %d. %slosure%s() ==> Twig_Template->render(): {
+         src: {
+-          %sCliDumperTest.php:{$line}: """
+-                    }\\n
+-                };'),\\n
+-            ));\\n
++          %sCliDumperTest.php:%d: """
++%A
+             """
+         }
+       }
diff -Nru symfony-2.8.7+dfsg/debian/patches/series symfony-2.8.7+dfsg/debian/patches/series
--- symfony-2.8.7+dfsg/debian/patches/series	2017-05-25 14:41:10.000000000 -0700
+++ symfony-2.8.7+dfsg/debian/patches/series	2017-05-26 12:57:41.000000000 -0700
@@ -7,3 +7,6 @@
 do-not-depend-on-a-fixed-date-in-layout-
 update-ipvalidatortest-data-set-with-a-v
 relax-1-test-failing-with-latest-php-ver
+fix-php-7.1-vardumper-failures
+fix-php-7.1-classloader-failures
+fix-php-7.1-filesystem-failures


-- System Information:
Debian Release: stretch/sid
  APT prefers zesty-updates
  APT policy: (500, 'zesty-updates'), (500, 'zesty-security'), (500, 'zesty'), (100, 'zesty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.10.0-21-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd



More information about the pkg-php-pear mailing list