From 5caa626d0d1458a68397ee5cdaacc5c87fba200c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 14 Apr 2017 06:44:52 +0200 Subject: v1.6.2 --- .gitignore | 7 +++ composer.json | 26 ++++++++ php-theseer-fDOMDocument-pr29.patch | 116 ++++++++++++++++++++++++++++++++++++ php-theseer-fDOMDocument.spec | 36 +++++++---- 4 files changed, 173 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 composer.json create mode 100644 php-theseer-fDOMDocument-pr29.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cd88df3 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "theseer/fdomdocument", + "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", + "homepage": "https://github.com/theseer/fDOMDocument", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/theseer/fDOMDocument/issues" + }, + "require": { + "php": ">=5.3.3", + "ext-dom": "*", + "lib-libxml": "*" + }, + "autoload": { + "classmap": [ + "src/" + ] + } +} diff --git a/php-theseer-fDOMDocument-pr29.patch b/php-theseer-fDOMDocument-pr29.patch new file mode 100644 index 0000000..aa245ec --- /dev/null +++ b/php-theseer-fDOMDocument-pr29.patch @@ -0,0 +1,116 @@ +From 419398ed434bb240487c42628a4bd30d6795ae81 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 14 Apr 2017 06:33:53 +0200 +Subject: [PATCH 1/2] fix (PHP 7.2) count(): Parameter must be an array or an + object that implements Countable + +--- + src/XPathQuery.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/XPathQuery.php b/src/XPathQuery.php +index ab7e3a9..cd661ad 100644 +--- a/src/XPathQuery.php ++++ b/src/XPathQuery.php +@@ -191,7 +191,7 @@ private function getXPathObjectFor(\DOMNode $ctx) { + */ + private function buildQuery(fDOMXPath $xp, array $values = NULL) { + $backup = $this->values; +- if (count($values) > 0) { ++ if (is_array($values) && count($values) > 0) { + foreach($values as $k => $v) { + $this->bind($k, $v); + } + +From c8069cbd0032a476a04c9147e89c8c015a7dd5de Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 14 Apr 2017 06:34:06 +0200 +Subject: [PATCH 2/2] allow modern PHPUnit + +--- + tests/Translator.test.php | 2 +- + tests/XPathQuery.test.php | 2 +- + tests/fDOMDocument.test.php | 2 +- + tests/fDOMDocumentFragment.test.php | 2 +- + tests/fDOMElement.test.php | 2 +- + tests/fDOMXPath.test.php | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/Translator.test.php b/tests/Translator.test.php +index 2152238..0c10cb1 100644 +--- a/tests/Translator.test.php ++++ b/tests/Translator.test.php +@@ -4,7 +4,7 @@ + + use TheSeer\fDOM\CSS\Translator; + +- class TranslatorTest extends \PHPUnit_Framework_TestCase { ++ class TranslatorTest extends \PHPUnit\Framework\TestCase { + + /** + * @dataProvider provider +diff --git a/tests/XPathQuery.test.php b/tests/XPathQuery.test.php +index fb0aeae..3bed435 100644 +--- a/tests/XPathQuery.test.php ++++ b/tests/XPathQuery.test.php +@@ -44,7 +44,7 @@ + use TheSeer\fDOM\XPathQuery; + use TheSeer\fDOM\fDOMDocument; + +- class XPathQueryTest extends \PHPUnit_Framework_TestCase { ++ class XPathQueryTest extends \PHPUnit\Framework\TestCase { + + private $dom; + +diff --git a/tests/fDOMDocument.test.php b/tests/fDOMDocument.test.php +index b7392d8..fd5c08f 100644 +--- a/tests/fDOMDocument.test.php ++++ b/tests/fDOMDocument.test.php +@@ -48,7 +48,7 @@ + * @author Arne Blankerts + * @copyright Arne Blankerts , All rights reserved. + */ +- class fDOMDocumentTest extends \PHPUnit_Framework_TestCase { ++ class fDOMDocumentTest extends \PHPUnit\Framework\TestCase { + + /** + * @var fDOMDocument +diff --git a/tests/fDOMDocumentFragment.test.php b/tests/fDOMDocumentFragment.test.php +index 1f2fcf3..d524bfe 100644 +--- a/tests/fDOMDocumentFragment.test.php ++++ b/tests/fDOMDocumentFragment.test.php +@@ -49,7 +49,7 @@ + * @author Arne Blankerts + * @copyright Arne Blankerts , All rights reserved. + */ +- class fDOMDocumentFragmentTest extends \PHPUnit_Framework_TestCase { ++ class fDOMDocumentFragmentTest extends \PHPUnit\Framework\TestCase { + + /** + * @var fDOMDocument +diff --git a/tests/fDOMElement.test.php b/tests/fDOMElement.test.php +index b7ae9b3..0e6a11c 100644 +--- a/tests/fDOMElement.test.php ++++ b/tests/fDOMElement.test.php +@@ -49,7 +49,7 @@ + * @author Arne Blankerts + * @copyright Arne Blankerts , All rights reserved. + */ +- class fDOMElementTest extends \PHPUnit_Framework_TestCase { ++ class fDOMElementTest extends \PHPUnit\Framework\TestCase { + + /** + * @var fDOMDocument +diff --git a/tests/fDOMXPath.test.php b/tests/fDOMXPath.test.php +index ce91e13..2504a75 100644 +--- a/tests/fDOMXPath.test.php ++++ b/tests/fDOMXPath.test.php +@@ -49,7 +49,7 @@ + * @author Arne Blankerts + * @copyright Arne Blankerts , All rights reserved. + */ +- class fDOMXPathTest extends \PHPUnit_Framework_TestCase { ++ class fDOMXPathTest extends \PHPUnit\Framework\TestCase { + + /** + * @var TheSeer\fDOM\fDOMDocument diff --git a/php-theseer-fDOMDocument.spec b/php-theseer-fDOMDocument.spec index 9d0bd4d..9f2be20 100644 --- a/php-theseer-fDOMDocument.spec +++ b/php-theseer-fDOMDocument.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # -%global gh_commit d9ad139d6c2e8edf5e313ffbe37ff13344cf0684 +%global gh_commit 1dbe93a2c98fe57d0dd9792c373ec75c21f70750 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner theseer %global gh_project fDOMDocument @@ -16,7 +16,7 @@ %global pear_channel pear.netpirates.net Name: php-theseer-fDOMDocument -Version: 1.6.1 +Version: 1.6.2 Release: 1%{?dist} Summary: An Extension to PHP standard DOM @@ -25,11 +25,17 @@ License: BSD URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: %{name}-pr29.patch + BuildArch: noarch BuildRequires: php(language) >= 5.3.3 # For test -BuildRequires: %{_bindir}/phpunit +%if 0%{?fedora} >= 26 +%global phpunit %{_bindir}/phpunit6 +%else +%global phpunit %{_bindir}/phpunit +%endif +BuildRequires: %{phpunit} BuildRequires: php-dom BuildRequires: php-libxml @@ -55,6 +61,7 @@ and exceptions by default %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 %build @@ -62,17 +69,19 @@ and exceptions by default %install -rm -rf %{buildroot} mkdir -p %{buildroot}%{php_home} cp -pr src %{buildroot}%{php_home}/%{gh_project} %check -phpunit - - -%clean -rm -rf %{buildroot} +ret=0 +for cmd in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do + if which $cmd; then + set $cmd + $1 ${2:-%{_bindir}/phpunit6} --verbose || ret=1 + fi +done +exit $ret %post @@ -83,7 +92,6 @@ fi %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.md composer.json @@ -91,6 +99,10 @@ fi %changelog +* Fri Apr 14 2017 Remi Collet - 1.6.2-1 +- Update to 1.6.2 +- use phpunit6 when available + * Thu May 28 2015 Remi Collet - 1.6.1-1 - Update to 1.6.1 @@ -122,4 +134,4 @@ fi * Thu Oct 11 2012 Remi Collet - 1.3.1-1 - Version 1.3.1 (stable) - API 1.3.0 (stable) -- Initial packaging \ No newline at end of file +- Initial packaging -- cgit