From ac4c0cc2049225302dba0e37cce9e3c7f3ae4c94 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 24 Oct 2017 13:33:36 +0200 Subject: fix FTBFS from Koschei, add patch for PHP 7.2 from https://github.com/zendframework/zend-stdlib/pull/81 --- .gitignore | 8 +++++ 81.patch | 68 ++++++++++++++++++++++++++++++++++++++ php-zendframework-zend-stdlib.spec | 36 ++++++++------------ 3 files changed, 89 insertions(+), 23 deletions(-) create mode 100644 .gitignore create mode 100644 81.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/81.patch b/81.patch new file mode 100644 index 0000000..c90600d --- /dev/null +++ b/81.patch @@ -0,0 +1,68 @@ +From 5c2f528c5e3b775b960adc128efc7717ff2db64c Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 24 Oct 2017 10:49:02 +0200 +Subject: [PATCH] Fix testCount for PHP 7.2 + +PHP 7.2 raise a deprecated message + Parameter must be an array or an object that implements Countable + +I think this should not be hidden (count could take care of this), +so this change declare the message as expected. + +A new test is added for object which are really countable +--- + test/ArrayObjectTest.php | 12 ++++++++++++ + test/TestAsset/ArrayObjectObjectCount.php | 17 +++++++++++++++++ + 2 files changed, 29 insertions(+) + create mode 100644 test/TestAsset/ArrayObjectObjectCount.php + +diff --git a/test/ArrayObjectTest.php b/test/ArrayObjectTest.php +index b09cab7e..1ab3e97b 100644 +--- a/test/ArrayObjectTest.php ++++ b/test/ArrayObjectTest.php +@@ -103,10 +103,22 @@ public function testAsort() + + public function testCount() + { ++ if (version_compare(PHP_VERSION, '7.2', '>=')) { ++ $this->setExpectedException( ++ 'PHPUnit_Framework_Error_Warning', ++ 'Parameter must be an array or an object that implements Countable' ++ ); ++ } + $ar = new ArrayObject(new TestAsset\ArrayObjectObjectVars()); + $this->assertEquals(1, $ar->count()); + } + ++ public function testCountable() ++ { ++ $ar = new ArrayObject(new TestAsset\ArrayObjectObjectCount()); ++ $this->assertEquals(42, $ar->count()); ++ } ++ + public function testExchangeArray() + { + $ar = new ArrayObject(['foo' => 'bar']); +diff --git a/test/TestAsset/ArrayObjectObjectCount.php b/test/TestAsset/ArrayObjectObjectCount.php +new file mode 100644 +index 00000000..7b40dbee +--- /dev/null ++++ b/test/TestAsset/ArrayObjectObjectCount.php +@@ -0,0 +1,17 @@ ++ - 3.1.0-4 +- fix FTBFS from Koschei, add patch for PHP 7.2 from + https://github.com/zendframework/zend-stdlib/pull/81 + * Tue Sep 13 2016 Remi Collet - 3.1.0-1 - update to 3.1.0 - raise dependency on PHP >= 5.6 -- cgit