summaryrefslogtreecommitdiffstats
path: root/php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-10-13 08:41:52 +0200
committerRemi Collet <remi@remirepo.net>2020-10-13 08:41:52 +0200
commit5a2725ef5c49dc7166ceb29a027563466fa0e6b5 (patch)
treed328dc16c99563ad36812d2c1e7fd3b8776d9886 /php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec
parentff7a5f9003bff9cbb407a438b0b76508e8cb599c (diff)
update to 1.2.0
drop dependency on phpunitgoodpractices/polyfill add patch for old phpunit from https://github.com/PHP-CS-Fixer/phpunit-constraint-xmlmatchesxsd/pull/12 switch to classmap autoloader
Diffstat (limited to 'php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec')
-rw-r--r--php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec70
1 files changed, 36 insertions, 34 deletions
diff --git a/php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec b/php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec
index d9c6ee7..d193e7c 100644
--- a/php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec
+++ b/php-cs-fixer-phpunit-constraint-xmlmatchesxsd.spec
@@ -1,12 +1,12 @@
# remirepo/fedora spec file for php-cs-fixer-phpunit-constraint-xmlmatchesxsd
#
-# Copyright (c) 2018-2019 Remi Collet
+# Copyright (c) 2018-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit 92e0ca8fd30b257a993a66511198267ca7d9d8eb
+%global gh_commit 526989325b1bb9a67f215108c490260cfdf6b4f1
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20150717
%global gh_owner PHP-CS-Fixer
@@ -19,7 +19,7 @@
%global with_tests 0%{!?_without_tests:1}
Name: %{pk_vendor}-%{pk_project}
-Version: 1.1.0
+Version: 1.2.0
Release: 1%{?dist}
Summary: Constraint for testing XML against XSD
@@ -29,6 +29,8 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
+Patch0: https://patch-diff.githubusercontent.com/raw/PHP-CS-Fixer/phpunit-constraint-xmlmatchesxsd/pull/12.patch
+
BuildArch: noarch
%if %{with_tests}
# For tests
@@ -39,41 +41,28 @@ BuildRequires: php-libxml
# "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
# "symfony/phpunit-bridge": "^3.2.2 || ^4.0"
# ignore phpunit listeners
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
+BuildRequires: phpunit9
+%endif
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
BuildRequires: phpunit8
%endif
%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8
BuildRequires: phpunit7
%endif
-# remirepo:1
-%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(phpunitgoodpractices/polyfill) >= 1.1 with php-composer(phpunitgoodpractices/polyfill) < 2)
-BuildRequires: phpunit6 >= 6.4.3
-# remirepo:3
-%else
-BuildRequires: php-phpunitgoodpractices-polyfill >= 1.1
-%endif
BuildRequires: php-composer(phpunit/phpunit) >= 5.7.23
# Autoloader
BuildRequires: php-fedora-autoloader-devel
%endif
# From composer.json, "require": {
-# "php": "^5.5 || ^7.0",
+# "php": "^5.5 || ^7.0 || ^8.0",
# "ext-dom": "*",
# "ext-libxml": "*",
-# "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0 || ^8.0",
-# "phpunitgoodpractices/polyfill": "^1.1"
+# "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0 || ^8.0 || ^9.0"
Requires: php(language) >= 5.5
Requires: php-dom
Requires: php-libxml
-# remirepo:1
-%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(phpunitgoodpractices/polyfill) >= 1.1 with php-composer(phpunitgoodpractices/polyfill) < 2)
-# remirepo:3
-%else
-Requires: php-phpunitgoodpractices-polyfill >= 1.1
-%endif
# ignore phpunit dep, package using it will run the proper phpunit command (and autoloader)
# From phpcompatinfo report for version 1.0.0
# nothing
@@ -91,23 +80,20 @@ Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
-cat << 'EOF' | tee src/autoload.php
-<?php
-/* autoloader for %{name} */
-\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__);
+%build
+: Generate a simple classmap autoloader
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+
\Fedora\Autoloader\Dependencies::required([
- '%{php_home}/PHPUnitGoodPractices/Polyfill/autoload.php',
__DIR__ . '/Constraint/XmlMatchesXsd.php',
]);
EOF
-%build
-# Empty build section, most likely nothing required.
-
-
%install
: Library
mkdir -p %{buildroot}%{php_home}/%{ns_vendor}
@@ -120,6 +106,7 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require '%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php';
+class_alias("PHPUnit_Framework_ExpectationFailedException", "PHPUnit\\Framework\\ExpectationFailedException");
EOF
: Disable the listeners
@@ -128,33 +115,40 @@ sed -e '/<listeners>/,/<\/listeners>/d' phpunit.xml.dist >phpunit.xml
: Run upstream test suite with each available phpunit version
ret=0
if [ -x %{_bindir}/phpunit ]; then
- for cmd in php php56 php70 php71 php72; do
+ for cmd in php php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit --verbose || ret=1
fi
done
fi
if [ -x %{_bindir}/phpunit6 ]; then
- for cmd in php php70 php71 php72; do
+ for cmd in php php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit6 --verbose || ret=1
fi
done
fi
if [ -x %{_bindir}/phpunit7 ]; then
- for cmd in php php71 php72; do
+ for cmd in php php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit7 --verbose || ret=1
fi
done
fi
if [ -x %{_bindir}/phpunit8 ]; then
- for cmd in php php72; do
+ for cmd in php php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit8 --verbose || ret=1
fi
done
fi
+if [ -x %{_bindir}/phpunit9 ]; then
+ for cmd in php php73 php74 php80; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit9 --verbose || ret=1
+ fi
+ done
+fi
exit $ret
%else
: Test suite disabled
@@ -162,6 +156,7 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -170,6 +165,13 @@ exit $ret
%changelog
+* Tue Oct 13 2020 Remi Collet <remi@remirepo.net> - 1.2.0-1
+- update to 1.2.0
+- drop dependency on phpunitgoodpractices/polyfill
+- add patch for old phpunit from
+ https://github.com/PHP-CS-Fixer/phpunit-constraint-xmlmatchesxsd/pull/12
+- switch to classmap autoloader
+
* Tue Mar 26 2019 Remi Collet <remi@remirepo.net> - 1.1.0-1
- update to 1.1.0
- raise dependency on phpunitgoodpractices/polyfill 1.1