From 9c52d767f4f5fd09ea0fb93a2431911a814621e0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 01:54:27 +0000 Subject: [PATCH 01/14] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index e927854..8a7f6fe 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 2.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jan 27 2021 Fedora Release Engineering - 2.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From bffe5fc4967f0ea498f77cdfb6218d31c1063960 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jan 2022 07:36:35 +0000 Subject: [PATCH 02/14] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 8a7f6fe..e7f2e35 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jan 21 2022 Fedora Release Engineering - 2.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 2.0.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 410e33af74b5fe5b4e6c4790c6e0905b235fa9d8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 13:30:17 +0000 Subject: [PATCH 03/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index e7f2e35..792550f 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 2.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri Jan 21 2022 Fedora Release Engineering - 2.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From eed2dbf7724bfe07ec17a5c577e9666d26bc4cf9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 20 Jan 2023 08:31:42 +0000 Subject: [PATCH 04/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 792550f..8d57a64 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jan 20 2023 Fedora Release Engineering - 2.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Jul 22 2022 Fedora Release Engineering - 2.0.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From e4a6031b6eed31af44c85246519e2be95c367fb1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jul 2023 04:21:36 +0000 Subject: [PATCH 05/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 8d57a64..60f7981 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jul 21 2023 Fedora Release Engineering - 2.0.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Fri Jan 20 2023 Fedora Release Engineering - 2.0.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 22590a8bd5a08bb3f0e0c3c7c4312ddbf7d8bfbb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 20:53:01 +0000 Subject: [PATCH 06/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 60f7981..eb05c59 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 2.0.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jul 21 2023 Fedora Release Engineering - 2.0.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 3f90db2313ce8d7f0c01e3428c7c1a4d95d4284e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 22:39:26 +0000 Subject: [PATCH 07/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index eb05c59..817af4c 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 2.0.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 2.0.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From fb8f39e4fa6d74080668fadcad5b726b1ad04b3d Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:46:49 +0200 Subject: [PATCH 08/14] Eliminate use of obsolete %patchN syntax (#2283636) --- php-hamcrest2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 817af4c..a2c1fa3 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -70,7 +70,7 @@ Autoloader: %{_datadir}/php/%{ns_project}%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p0 -b .rpm +%patch -P0 -p0 -b .rpm find . -name \*.rpm -exec rm {} \; # Move to Library tree From ad8aa2451c0364f9c23339a48eacfba8c5b72b5b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jul 2024 06:54:32 +0000 Subject: [PATCH 09/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index a2c1fa3..07a03be 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD @@ -120,6 +120,9 @@ exit $ret %changelog +* Fri Jul 19 2024 Fedora Release Engineering - 2.0.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Thu Jan 25 2024 Fedora Release Engineering - 2.0.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From a1ec889cd750b1b4b40ab4942517b5be79fdff2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 4 Sep 2024 18:59:07 +0200 Subject: [PATCH 10/14] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- php-hamcrest2.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 07a03be..829c2d9 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,10 +16,11 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: PHP port of Hamcrest Matchers -License: BSD +# Automatically converted from old format: BSD - review is highly recommended. +License: LicenseRef-Callaway-BSD URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz @@ -120,6 +121,9 @@ exit $ret %changelog +* Wed Sep 4 2024 Miroslav Suchý - 2.0.1-12 +- convert license to SPDX + * Fri Jul 19 2024 Fedora Release Engineering - 2.0.1-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 0b66b8fe45fab6fb6447a7c88e4d9ab1f997e31e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 18 Jan 2025 09:04:56 +0000 Subject: [PATCH 11/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 829c2d9..29cc03f 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -16,7 +16,7 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: PHP port of Hamcrest Matchers # Automatically converted from old format: BSD - review is highly recommended. @@ -121,6 +121,9 @@ exit $ret %changelog +* Sat Jan 18 2025 Fedora Release Engineering - 2.0.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Sep 4 2024 Miroslav Suchý - 2.0.1-12 - convert license to SPDX From 62a1ce3e53d2b8e0e7a52626743ccb2b5084b008 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Jan 2025 16:36:25 +0100 Subject: [PATCH 12/14] switch to phpunit9 re-license spec file to CECILL-2.1 --- php-hamcrest2.spec | 31 ++-- upstream.patch | 397 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 415 insertions(+), 13 deletions(-) create mode 100644 upstream.patch diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 29cc03f..244fb5e 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -1,8 +1,8 @@ -# remirepo/fedora spec file for php-hamcrest +# remirepo/fedora spec file for php-hamcrest2 # -# Copyright (c) 2015-2020 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2015-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -16,24 +16,25 @@ Name: php-hamcrest2 Version: 2.0.1 -Release: 13%{?dist} +Release: 12%{?dist} Summary: PHP port of Hamcrest Matchers -# Automatically converted from old format: BSD - review is highly recommended. -License: LicenseRef-Callaway-BSD +License: BSD-3-Clause URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz # Use generated autoloader instead of composer one Patch0: bootstrap-autoload.patch +# Upstream patch for testsuite +Patch1: upstream.patch BuildArch: noarch BuildRequires: php-fedora-autoloader-devel %if %{with tests} # From composer.json, require-dev: # "phpunit/php-file-iterator": "^1.4 || ^2.0", -# "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" -BuildRequires: phpunit7 +# "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" +BuildRequires: phpunit9 # composer.json, require: # "php": "^5.3|^7.0|^8.0" BuildRequires: php(language) >= 5.3 @@ -72,7 +73,8 @@ Autoloader: %{_datadir}/php/%{ns_project}%{major}/autoload.php %setup -q -n %{gh_project}-%{gh_commit} %patch -P0 -p0 -b .rpm -find . -name \*.rpm -exec rm {} \; +%patch -P1 -p1 -b .up +find . -name \*.rpm -o -name \*.up -exec rm {} \; # Move to Library tree mv hamcrest/%{ns_project}.php hamcrest/%{ns_project}/%{ns_project}.php @@ -101,9 +103,9 @@ cp -pr hamcrest/%{ns_project} %{buildroot}%{_datadir}/php/%{ns_project}%{major} %if %{with tests} cd tests ret=0 -for cmd in php php72 php73 php74; do +for cmd in php php81 php82 php83 php84; do if which $cmd; then - $cmd %{_bindir}/phpunit7 --verbose || ret=1 + $cmd %{_bindir}/phpunit9 --verbose || ret=1 fi done exit $ret @@ -113,7 +115,6 @@ exit $ret %files -%{!?_licensedir:%global license %%doc} %license LICENSE.txt %doc CHANGES.txt README.md %doc composer.json @@ -121,6 +122,10 @@ exit $ret %changelog +* Wed Jan 22 2025 Remi Collet - 2.0.1-12 +- switch to phpunit9 +- re-license spec file to CECILL-2.1 + * Sat Jan 18 2025 Fedora Release Engineering - 2.0.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/upstream.patch b/upstream.patch new file mode 100644 index 0000000..f01e722 --- /dev/null +++ b/upstream.patch @@ -0,0 +1,397 @@ +From 696163addf28bb4e01455254e055a9a75e0ba6c4 Mon Sep 17 00:00:00 2001 +From: Fabien Villepinte +Date: Thu, 14 Dec 2023 12:00:58 +0100 +Subject: [PATCH] Allow installation of PHPUnit 8 in order to test with PHP 8.1 + and 8.2 (#82) + +* Allow installation of PHPUnit 8 +* Run the tests with PHP 8.1 and 8.2 +--- + .github/workflows/tests.yml | 9 ++------- + .gitignore | 1 + + composer.json | 2 +- + tests/Hamcrest/Core/CombinableMatcherTest.php | 5 ++++- + tests/Hamcrest/Core/IsInstanceOfTest.php | 5 ++++- + tests/Hamcrest/Core/SetTest.php | 5 ++++- + tests/Hamcrest/FeatureMatcherTest.php | 5 ++++- + tests/Hamcrest/MatcherAssertTest.php | 5 ++++- + tests/Hamcrest/StringDescriptionTest.php | 5 ++++- + tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php | 5 ++++- + tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php | 5 ++++- + tests/Hamcrest/Text/StringContainsInOrderTest.php | 5 ++++- + tests/Hamcrest/Text/StringContainsTest.php | 5 ++++- + tests/Hamcrest/Text/StringEndsWithTest.php | 5 ++++- + tests/Hamcrest/Text/StringStartsWithTest.php | 5 ++++- + tests/Hamcrest/Xml/HasXPathTest.php | 5 ++++- + 16 files changed, 56 insertions(+), 21 deletions(-) + +diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml +index 06255a1b9..f23413216 100644 +--- a/.github/workflows/tests.yml ++++ b/.github/workflows/tests.yml +@@ -10,7 +10,7 @@ jobs: + runs-on: ubuntu-latest + strategy: + matrix: +- php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] ++ php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + + name: PHP ${{ matrix.php }} + +@@ -26,13 +26,8 @@ jobs: + tools: composer:v2 + coverage: none + +- - name: Install PHP 7 dependencies ++ - name: Install PHP dependencies + run: composer update --prefer-dist --no-interaction --no-progress +- if: "matrix.php != '8.0'" +- +- - name: Install PHP 8 dependencies +- run: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-reqs +- if: "matrix.php == '8.0'" + + - name: Execute tests + run: vendor/bin/phpunit -c tests/phpunit.xml.dist +diff --git a/.gitignore b/.gitignore +index 987e2a253..7611d841f 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,2 +1,3 @@ + composer.lock ++tests/.phpunit.result.cache + vendor +diff --git a/composer.json b/composer.json +index 712ad9655..180f341d8 100644 +--- a/composer.json ++++ b/composer.json +@@ -20,7 +20,7 @@ + + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", +- "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" ++ "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0" + }, + + "replace": { +diff --git a/tests/Hamcrest/Core/CombinableMatcherTest.php b/tests/Hamcrest/Core/CombinableMatcherTest.php +index 463c75437..ef9418674 100644 +--- a/tests/Hamcrest/Core/CombinableMatcherTest.php ++++ b/tests/Hamcrest/Core/CombinableMatcherTest.php +@@ -7,7 +7,10 @@ class CombinableMatcherTest extends \Hamcrest\AbstractMatcherTest + private $_either_3_or_4; + private $_not_3_and_not_4; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4)); + $this->_not_3_and_not_4 = \Hamcrest\Core\CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4))); +diff --git a/tests/Hamcrest/Core/IsInstanceOfTest.php b/tests/Hamcrest/Core/IsInstanceOfTest.php +index f74cfdb52..b4fdd04fd 100644 +--- a/tests/Hamcrest/Core/IsInstanceOfTest.php ++++ b/tests/Hamcrest/Core/IsInstanceOfTest.php +@@ -7,7 +7,10 @@ class IsInstanceOfTest extends \Hamcrest\AbstractMatcherTest + private $_baseClassInstance; + private $_subClassInstance; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good'); + $this->_subClassInstance = new \Hamcrest\Core\SampleSubClass('good'); +diff --git a/tests/Hamcrest/Core/SetTest.php b/tests/Hamcrest/Core/SetTest.php +index aa5e4e7be..f00efa4f4 100644 +--- a/tests/Hamcrest/Core/SetTest.php ++++ b/tests/Hamcrest/Core/SetTest.php +@@ -7,7 +7,10 @@ class SetTest extends \Hamcrest\AbstractMatcherTest + public static $_classProperty; + public $_instanceProperty; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + self::$_classProperty = null; + unset($this->_instanceProperty); +diff --git a/tests/Hamcrest/FeatureMatcherTest.php b/tests/Hamcrest/FeatureMatcherTest.php +index 1b0230498..dfae872bf 100644 +--- a/tests/Hamcrest/FeatureMatcherTest.php ++++ b/tests/Hamcrest/FeatureMatcherTest.php +@@ -34,7 +34,10 @@ class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest + + private $_resultMatcher; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_resultMatcher = $this->_resultMatcher(); + } +diff --git a/tests/Hamcrest/MatcherAssertTest.php b/tests/Hamcrest/MatcherAssertTest.php +index dc12fba54..e34919869 100644 +--- a/tests/Hamcrest/MatcherAssertTest.php ++++ b/tests/Hamcrest/MatcherAssertTest.php +@@ -6,7 +6,10 @@ + class MatcherAssertTest extends TestCase + { + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + \Hamcrest\MatcherAssert::resetCount(); + } +diff --git a/tests/Hamcrest/StringDescriptionTest.php b/tests/Hamcrest/StringDescriptionTest.php +index ed716d13e..b42b9b469 100644 +--- a/tests/Hamcrest/StringDescriptionTest.php ++++ b/tests/Hamcrest/StringDescriptionTest.php +@@ -23,7 +23,10 @@ class StringDescriptionTest extends TestCase + + private $_description; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_description = new \Hamcrest\StringDescription(); + } +diff --git a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php +index 27ad338b7..42444489f 100644 +--- a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php ++++ b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php +@@ -6,7 +6,10 @@ class IsEqualIgnoringWhiteSpaceTest extends \Hamcrest\AbstractMatcherTest + + private $_matcher; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace( + "Hello World how\n are we? " +diff --git a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php +index 73023007b..8b4463a9e 100644 +--- a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php ++++ b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php +@@ -8,7 +8,10 @@ class StringContainsIgnoringCaseTest extends \Hamcrest\AbstractMatcherTest + + private $_stringContains; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase( + strtolower(self::EXCERPT) +diff --git a/tests/Hamcrest/Text/StringContainsInOrderTest.php b/tests/Hamcrest/Text/StringContainsInOrderTest.php +index 4c465b29d..adb8658f4 100644 +--- a/tests/Hamcrest/Text/StringContainsInOrderTest.php ++++ b/tests/Hamcrest/Text/StringContainsInOrderTest.php +@@ -6,7 +6,10 @@ class StringContainsInOrderTest extends \Hamcrest\AbstractMatcherTest + + private $_m; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_m = \Hamcrest\Text\StringContainsInOrder::stringContainsInOrder(array('a', 'b', 'c')); + } +diff --git a/tests/Hamcrest/Text/StringContainsTest.php b/tests/Hamcrest/Text/StringContainsTest.php +index bf4afa3c9..814c1ca1b 100644 +--- a/tests/Hamcrest/Text/StringContainsTest.php ++++ b/tests/Hamcrest/Text/StringContainsTest.php +@@ -8,7 +8,10 @@ class StringContainsTest extends \Hamcrest\AbstractMatcherTest + + private $_stringContains; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_stringContains = \Hamcrest\Text\StringContains::containsString(self::EXCERPT); + } +diff --git a/tests/Hamcrest/Text/StringEndsWithTest.php b/tests/Hamcrest/Text/StringEndsWithTest.php +index 9a30f9520..46177f464 100644 +--- a/tests/Hamcrest/Text/StringEndsWithTest.php ++++ b/tests/Hamcrest/Text/StringEndsWithTest.php +@@ -8,7 +8,10 @@ class StringEndsWithTest extends \Hamcrest\AbstractMatcherTest + + private $_stringEndsWith; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_stringEndsWith = \Hamcrest\Text\StringEndsWith::endsWith(self::EXCERPT); + } +diff --git a/tests/Hamcrest/Text/StringStartsWithTest.php b/tests/Hamcrest/Text/StringStartsWithTest.php +index 3be201f1a..f0eb14b7e 100644 +--- a/tests/Hamcrest/Text/StringStartsWithTest.php ++++ b/tests/Hamcrest/Text/StringStartsWithTest.php +@@ -8,7 +8,10 @@ class StringStartsWithTest extends \Hamcrest\AbstractMatcherTest + + private $_stringStartsWith; + +- protected function setUp() ++ /** ++ * @before ++ */ ++ protected function setUpTest() + { + $this->_stringStartsWith = \Hamcrest\Text\StringStartsWith::startsWith(self::EXCERPT); + } +diff --git a/tests/Hamcrest/Xml/HasXPathTest.php b/tests/Hamcrest/Xml/HasXPathTest.php +index 677488716..3db5e46e0 100644 +--- a/tests/Hamcrest/Xml/HasXPathTest.php ++++ b/tests/Hamcrest/Xml/HasXPathTest.php +@@ -7,7 +7,10 @@ class HasXPathTest extends \Hamcrest\AbstractMatcherTest + protected static $doc; + protected static $html; + +- public static function setUpBeforeClass() ++ /** ++ * @beforeClass ++ */ ++ public static function setUpBeforeClassTest() + { + self::$xml = << +From 103d1443ec6c552ff1c15e2bddbb9ce7c96528be Mon Sep 17 00:00:00 2001 +From: Fabien Villepinte +Date: Fri, 3 May 2024 15:45:43 +0200 +Subject: [PATCH] Fix all PHPUnit's deprecations + +--- + .github/workflows/tests.yml | 14 +++++++++++++- + tests/Hamcrest/UtilTest.php | 23 +++++++++++++++-------- + 2 files changed, 28 insertions(+), 9 deletions(-) + +diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml +index f23413216..68b483587 100644 +--- a/.github/workflows/tests.yml ++++ b/.github/workflows/tests.yml +@@ -10,7 +10,19 @@ jobs: + runs-on: ubuntu-latest + strategy: + matrix: +- php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] ++ php: ++ - '5.3' ++ - '5.4' ++ - '5.5' ++ - '5.6' ++ - '7.0' ++ - '7.1' ++ - '7.2' ++ - '7.3' ++ - '7.4' ++ - '8.0' ++ - '8.1' ++ - '8.2' + + name: PHP ${{ matrix.php }} + +diff --git a/tests/Hamcrest/UtilTest.php b/tests/Hamcrest/UtilTest.php +index 7248978c7..1fec63eed 100644 +--- a/tests/Hamcrest/UtilTest.php ++++ b/tests/Hamcrest/UtilTest.php +@@ -28,21 +28,28 @@ public function testCheckAllAreMatchersAcceptsMatchers() + )); + } + +- /** +- * @expectedException InvalidArgumentException +- */ + public function testCheckAllAreMatchersFailsForPrimitive() + { +- \Hamcrest\Util::checkAllAreMatchers(array( +- new \Hamcrest\Text\MatchesPattern('/fo+/'), +- 'foo', +- )); ++ $exceptionThrown = false; ++ try { ++ \Hamcrest\Util::checkAllAreMatchers(array( ++ new \Hamcrest\Text\MatchesPattern('/fo+/'), ++ 'foo', ++ )); ++ } catch (\InvalidArgumentException $exception) { ++ $exceptionThrown = true; ++ } ++ ++ $this->assertTrue( ++ $exceptionThrown, ++ 'Failed asserting that exception of type "InvalidArgumentException" is thrown.' ++ ); + } + + private function callAndAssertCreateMatcherArray($items) + { + $matchers = \Hamcrest\Util::createMatcherArray($items); +- $this->assertInternalType('array', $matchers); ++ $this->assertTrue(is_array($matchers), sprintf('Type "array" expected, but got "%s" instead', gettype($matchers))); + $this->assertSameSize($items, $matchers); + foreach ($matchers as $matcher) { + $this->assertInstanceOf('\Hamcrest\Matcher', $matcher); +From e3b7bfcda4bc88f94e7f37f2a3a3380d4944735d Mon Sep 17 00:00:00 2001 +From: Fabien Villepinte +Date: Fri, 3 May 2024 15:50:55 +0200 +Subject: [PATCH] Allow installation of PHPUnit 9 in order to test with PHP 8.3 + +--- + .github/workflows/tests.yml | 1 + + composer.json | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml +index 68b483587..de0cfff6f 100644 +--- a/.github/workflows/tests.yml ++++ b/.github/workflows/tests.yml +@@ -23,6 +23,7 @@ jobs: + - '8.0' + - '8.1' + - '8.2' ++ - '8.3' + + name: PHP ${{ matrix.php }} + +diff --git a/composer.json b/composer.json +index 180f341d8..c89b279e1 100644 +--- a/composer.json ++++ b/composer.json +@@ -19,8 +19,8 @@ + }, + + "require-dev": { +- "phpunit/php-file-iterator": "^1.4 || ^2.0", +- "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0" ++ "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", ++ "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + + "replace": { From c91a45c5ad526706016e46ca826e3307922a7077 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 6 May 2025 11:28:37 +0200 Subject: [PATCH 13/14] v2.1.1 --- .gitignore | 2 + makesrc.sh | 33 ++++ php-hamcrest2.spec | 41 +++-- sources | 2 +- upstream.patch | 397 --------------------------------------------- 5 files changed, 56 insertions(+), 419 deletions(-) create mode 100755 makesrc.sh delete mode 100644 upstream.patch diff --git a/.gitignore b/.gitignore index e875194..567a3f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +clog /php-hamcrest2-2.0.0-776503d.tar.gz /php-hamcrest2-2.0.1-8c3d0a3.tar.gz +/php-hamcrest2-2.1.1-f8b1c01.tgz diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..142ce02 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec) +DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.spec) +OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +DATE=$(date -d "$DATE -4 days" +%Y-%m-%d) + +if [ -f $NAME-$VERSION-$SHORT.tgz ]; then + echo "Skip $NAME-$VERSION-$SHORT.tgz" +else + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT, Date=$DATE\n" + + echo "Cloning..." + git clone --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || exit 1 + + echo "Getting commit..." + pushd $PROJECT-$COMMIT + git checkout $COMMIT || exit1 + cp composer.json ../ + popd + + echo "Archiving..." + tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT + + echo "Cleaning..." + rm -rf $PROJECT-$COMMIT +fi + diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index 244fb5e..b61484b 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -6,7 +6,8 @@ # # Please, preserve the changelog entries # -%global gh_commit 8c3d0a3f6af734494ad8f6fbbee0ba92422859f3 +%global gh_date 2025-04-30 +%global gh_commit f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner hamcrest %global gh_project hamcrest-php @@ -15,43 +16,38 @@ %bcond_without tests Name: php-hamcrest2 -Version: 2.0.1 -Release: 12%{?dist} +Version: 2.1.1 +Release: 1%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD-3-Clause URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +# git snapshot with tests +Source0: %{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh # Use generated autoloader instead of composer one Patch0: bootstrap-autoload.patch -# Upstream patch for testsuite -Patch1: upstream.patch BuildArch: noarch BuildRequires: php-fedora-autoloader-devel %if %{with tests} # From composer.json, require-dev: -# "phpunit/php-file-iterator": "^1.4 || ^2.0", +# "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", # "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" BuildRequires: phpunit9 -# composer.json, require: -# "php": "^5.3|^7.0|^8.0" -BuildRequires: php(language) >= 5.3 -# From phpcompatinfo report for 2.0.0 -BuildRequires: php-reflection +BuildRequires: php(language) >= 7.4 +# From phpcompatinfo report for 2.1.1 BuildRequires: php-ctype BuildRequires: php-dom -BuildRequires: php-pcre -BuildRequires: php-spl %endif -Requires: php(language) >= 5.3 -# From phpcompatinfo report for 2.0.0 +# composer.json, require: +# "php": "^7.4|^8.0" +Requires: php(language) >= 7.4 +# From phpcompatinfo report for 2.1.1 Requires: php-ctype Requires: php-dom -Requires: php-pcre -Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -73,8 +69,7 @@ Autoloader: %{_datadir}/php/%{ns_project}%{major}/autoload.php %setup -q -n %{gh_project}-%{gh_commit} %patch -P0 -p0 -b .rpm -%patch -P1 -p1 -b .up -find . -name \*.rpm -o -name \*.up -exec rm {} \; +find . -name \*.rpm -exec rm {} \; -print # Move to Library tree mv hamcrest/%{ns_project}.php hamcrest/%{ns_project}/%{ns_project}.php @@ -105,7 +100,7 @@ cd tests ret=0 for cmd in php php81 php82 php83 php84; do if which $cmd; then - $cmd %{_bindir}/phpunit9 --verbose || ret=1 + $cmd %{_bindir}/phpunit9 || ret=1 fi done exit $ret @@ -122,6 +117,10 @@ exit $ret %changelog +* Tue May 6 2025 Remi Collet - 2.1.1-1 +- update to 2.1.1 +- raise dependency on PHP 7.4 + * Wed Jan 22 2025 Remi Collet - 2.0.1-12 - switch to phpunit9 - re-license spec file to CECILL-2.1 diff --git a/sources b/sources index 1f11677..df95ef0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-hamcrest2-2.0.1-8c3d0a3.tar.gz) = 2c958c239f9aa6239ebf5cba190b94f2db39ab84d9bde8a435bcf3c212dc3b6e362f295f5a989f5dff571e0516c742ea37cdb1fd5c64b37a5076938cc57e8807 +SHA512 (php-hamcrest2-2.1.1-f8b1c01.tgz) = 04bd4aa0c71e49622cfd275ab93886f6e0150607d5918a89458c80964abf81031f57b4558786b0b07530d84b36a5c5d8db83ebc51edefde790d163e57a89fec5 diff --git a/upstream.patch b/upstream.patch deleted file mode 100644 index f01e722..0000000 --- a/upstream.patch +++ /dev/null @@ -1,397 +0,0 @@ -From 696163addf28bb4e01455254e055a9a75e0ba6c4 Mon Sep 17 00:00:00 2001 -From: Fabien Villepinte -Date: Thu, 14 Dec 2023 12:00:58 +0100 -Subject: [PATCH] Allow installation of PHPUnit 8 in order to test with PHP 8.1 - and 8.2 (#82) - -* Allow installation of PHPUnit 8 -* Run the tests with PHP 8.1 and 8.2 ---- - .github/workflows/tests.yml | 9 ++------- - .gitignore | 1 + - composer.json | 2 +- - tests/Hamcrest/Core/CombinableMatcherTest.php | 5 ++++- - tests/Hamcrest/Core/IsInstanceOfTest.php | 5 ++++- - tests/Hamcrest/Core/SetTest.php | 5 ++++- - tests/Hamcrest/FeatureMatcherTest.php | 5 ++++- - tests/Hamcrest/MatcherAssertTest.php | 5 ++++- - tests/Hamcrest/StringDescriptionTest.php | 5 ++++- - tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php | 5 ++++- - tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php | 5 ++++- - tests/Hamcrest/Text/StringContainsInOrderTest.php | 5 ++++- - tests/Hamcrest/Text/StringContainsTest.php | 5 ++++- - tests/Hamcrest/Text/StringEndsWithTest.php | 5 ++++- - tests/Hamcrest/Text/StringStartsWithTest.php | 5 ++++- - tests/Hamcrest/Xml/HasXPathTest.php | 5 ++++- - 16 files changed, 56 insertions(+), 21 deletions(-) - -diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml -index 06255a1b9..f23413216 100644 ---- a/.github/workflows/tests.yml -+++ b/.github/workflows/tests.yml -@@ -10,7 +10,7 @@ jobs: - runs-on: ubuntu-latest - strategy: - matrix: -- php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] -+ php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] - - name: PHP ${{ matrix.php }} - -@@ -26,13 +26,8 @@ jobs: - tools: composer:v2 - coverage: none - -- - name: Install PHP 7 dependencies -+ - name: Install PHP dependencies - run: composer update --prefer-dist --no-interaction --no-progress -- if: "matrix.php != '8.0'" -- -- - name: Install PHP 8 dependencies -- run: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-reqs -- if: "matrix.php == '8.0'" - - - name: Execute tests - run: vendor/bin/phpunit -c tests/phpunit.xml.dist -diff --git a/.gitignore b/.gitignore -index 987e2a253..7611d841f 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,2 +1,3 @@ - composer.lock -+tests/.phpunit.result.cache - vendor -diff --git a/composer.json b/composer.json -index 712ad9655..180f341d8 100644 ---- a/composer.json -+++ b/composer.json -@@ -20,7 +20,7 @@ - - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", -- "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" -+ "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0" - }, - - "replace": { -diff --git a/tests/Hamcrest/Core/CombinableMatcherTest.php b/tests/Hamcrest/Core/CombinableMatcherTest.php -index 463c75437..ef9418674 100644 ---- a/tests/Hamcrest/Core/CombinableMatcherTest.php -+++ b/tests/Hamcrest/Core/CombinableMatcherTest.php -@@ -7,7 +7,10 @@ class CombinableMatcherTest extends \Hamcrest\AbstractMatcherTest - private $_either_3_or_4; - private $_not_3_and_not_4; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4)); - $this->_not_3_and_not_4 = \Hamcrest\Core\CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4))); -diff --git a/tests/Hamcrest/Core/IsInstanceOfTest.php b/tests/Hamcrest/Core/IsInstanceOfTest.php -index f74cfdb52..b4fdd04fd 100644 ---- a/tests/Hamcrest/Core/IsInstanceOfTest.php -+++ b/tests/Hamcrest/Core/IsInstanceOfTest.php -@@ -7,7 +7,10 @@ class IsInstanceOfTest extends \Hamcrest\AbstractMatcherTest - private $_baseClassInstance; - private $_subClassInstance; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good'); - $this->_subClassInstance = new \Hamcrest\Core\SampleSubClass('good'); -diff --git a/tests/Hamcrest/Core/SetTest.php b/tests/Hamcrest/Core/SetTest.php -index aa5e4e7be..f00efa4f4 100644 ---- a/tests/Hamcrest/Core/SetTest.php -+++ b/tests/Hamcrest/Core/SetTest.php -@@ -7,7 +7,10 @@ class SetTest extends \Hamcrest\AbstractMatcherTest - public static $_classProperty; - public $_instanceProperty; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - self::$_classProperty = null; - unset($this->_instanceProperty); -diff --git a/tests/Hamcrest/FeatureMatcherTest.php b/tests/Hamcrest/FeatureMatcherTest.php -index 1b0230498..dfae872bf 100644 ---- a/tests/Hamcrest/FeatureMatcherTest.php -+++ b/tests/Hamcrest/FeatureMatcherTest.php -@@ -34,7 +34,10 @@ class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest - - private $_resultMatcher; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_resultMatcher = $this->_resultMatcher(); - } -diff --git a/tests/Hamcrest/MatcherAssertTest.php b/tests/Hamcrest/MatcherAssertTest.php -index dc12fba54..e34919869 100644 ---- a/tests/Hamcrest/MatcherAssertTest.php -+++ b/tests/Hamcrest/MatcherAssertTest.php -@@ -6,7 +6,10 @@ - class MatcherAssertTest extends TestCase - { - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - \Hamcrest\MatcherAssert::resetCount(); - } -diff --git a/tests/Hamcrest/StringDescriptionTest.php b/tests/Hamcrest/StringDescriptionTest.php -index ed716d13e..b42b9b469 100644 ---- a/tests/Hamcrest/StringDescriptionTest.php -+++ b/tests/Hamcrest/StringDescriptionTest.php -@@ -23,7 +23,10 @@ class StringDescriptionTest extends TestCase - - private $_description; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_description = new \Hamcrest\StringDescription(); - } -diff --git a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php -index 27ad338b7..42444489f 100644 ---- a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php -+++ b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php -@@ -6,7 +6,10 @@ class IsEqualIgnoringWhiteSpaceTest extends \Hamcrest\AbstractMatcherTest - - private $_matcher; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace( - "Hello World how\n are we? " -diff --git a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php -index 73023007b..8b4463a9e 100644 ---- a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php -+++ b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php -@@ -8,7 +8,10 @@ class StringContainsIgnoringCaseTest extends \Hamcrest\AbstractMatcherTest - - private $_stringContains; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase( - strtolower(self::EXCERPT) -diff --git a/tests/Hamcrest/Text/StringContainsInOrderTest.php b/tests/Hamcrest/Text/StringContainsInOrderTest.php -index 4c465b29d..adb8658f4 100644 ---- a/tests/Hamcrest/Text/StringContainsInOrderTest.php -+++ b/tests/Hamcrest/Text/StringContainsInOrderTest.php -@@ -6,7 +6,10 @@ class StringContainsInOrderTest extends \Hamcrest\AbstractMatcherTest - - private $_m; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_m = \Hamcrest\Text\StringContainsInOrder::stringContainsInOrder(array('a', 'b', 'c')); - } -diff --git a/tests/Hamcrest/Text/StringContainsTest.php b/tests/Hamcrest/Text/StringContainsTest.php -index bf4afa3c9..814c1ca1b 100644 ---- a/tests/Hamcrest/Text/StringContainsTest.php -+++ b/tests/Hamcrest/Text/StringContainsTest.php -@@ -8,7 +8,10 @@ class StringContainsTest extends \Hamcrest\AbstractMatcherTest - - private $_stringContains; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_stringContains = \Hamcrest\Text\StringContains::containsString(self::EXCERPT); - } -diff --git a/tests/Hamcrest/Text/StringEndsWithTest.php b/tests/Hamcrest/Text/StringEndsWithTest.php -index 9a30f9520..46177f464 100644 ---- a/tests/Hamcrest/Text/StringEndsWithTest.php -+++ b/tests/Hamcrest/Text/StringEndsWithTest.php -@@ -8,7 +8,10 @@ class StringEndsWithTest extends \Hamcrest\AbstractMatcherTest - - private $_stringEndsWith; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_stringEndsWith = \Hamcrest\Text\StringEndsWith::endsWith(self::EXCERPT); - } -diff --git a/tests/Hamcrest/Text/StringStartsWithTest.php b/tests/Hamcrest/Text/StringStartsWithTest.php -index 3be201f1a..f0eb14b7e 100644 ---- a/tests/Hamcrest/Text/StringStartsWithTest.php -+++ b/tests/Hamcrest/Text/StringStartsWithTest.php -@@ -8,7 +8,10 @@ class StringStartsWithTest extends \Hamcrest\AbstractMatcherTest - - private $_stringStartsWith; - -- protected function setUp() -+ /** -+ * @before -+ */ -+ protected function setUpTest() - { - $this->_stringStartsWith = \Hamcrest\Text\StringStartsWith::startsWith(self::EXCERPT); - } -diff --git a/tests/Hamcrest/Xml/HasXPathTest.php b/tests/Hamcrest/Xml/HasXPathTest.php -index 677488716..3db5e46e0 100644 ---- a/tests/Hamcrest/Xml/HasXPathTest.php -+++ b/tests/Hamcrest/Xml/HasXPathTest.php -@@ -7,7 +7,10 @@ class HasXPathTest extends \Hamcrest\AbstractMatcherTest - protected static $doc; - protected static $html; - -- public static function setUpBeforeClass() -+ /** -+ * @beforeClass -+ */ -+ public static function setUpBeforeClassTest() - { - self::$xml = << -From 103d1443ec6c552ff1c15e2bddbb9ce7c96528be Mon Sep 17 00:00:00 2001 -From: Fabien Villepinte -Date: Fri, 3 May 2024 15:45:43 +0200 -Subject: [PATCH] Fix all PHPUnit's deprecations - ---- - .github/workflows/tests.yml | 14 +++++++++++++- - tests/Hamcrest/UtilTest.php | 23 +++++++++++++++-------- - 2 files changed, 28 insertions(+), 9 deletions(-) - -diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml -index f23413216..68b483587 100644 ---- a/.github/workflows/tests.yml -+++ b/.github/workflows/tests.yml -@@ -10,7 +10,19 @@ jobs: - runs-on: ubuntu-latest - strategy: - matrix: -- php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] -+ php: -+ - '5.3' -+ - '5.4' -+ - '5.5' -+ - '5.6' -+ - '7.0' -+ - '7.1' -+ - '7.2' -+ - '7.3' -+ - '7.4' -+ - '8.0' -+ - '8.1' -+ - '8.2' - - name: PHP ${{ matrix.php }} - -diff --git a/tests/Hamcrest/UtilTest.php b/tests/Hamcrest/UtilTest.php -index 7248978c7..1fec63eed 100644 ---- a/tests/Hamcrest/UtilTest.php -+++ b/tests/Hamcrest/UtilTest.php -@@ -28,21 +28,28 @@ public function testCheckAllAreMatchersAcceptsMatchers() - )); - } - -- /** -- * @expectedException InvalidArgumentException -- */ - public function testCheckAllAreMatchersFailsForPrimitive() - { -- \Hamcrest\Util::checkAllAreMatchers(array( -- new \Hamcrest\Text\MatchesPattern('/fo+/'), -- 'foo', -- )); -+ $exceptionThrown = false; -+ try { -+ \Hamcrest\Util::checkAllAreMatchers(array( -+ new \Hamcrest\Text\MatchesPattern('/fo+/'), -+ 'foo', -+ )); -+ } catch (\InvalidArgumentException $exception) { -+ $exceptionThrown = true; -+ } -+ -+ $this->assertTrue( -+ $exceptionThrown, -+ 'Failed asserting that exception of type "InvalidArgumentException" is thrown.' -+ ); - } - - private function callAndAssertCreateMatcherArray($items) - { - $matchers = \Hamcrest\Util::createMatcherArray($items); -- $this->assertInternalType('array', $matchers); -+ $this->assertTrue(is_array($matchers), sprintf('Type "array" expected, but got "%s" instead', gettype($matchers))); - $this->assertSameSize($items, $matchers); - foreach ($matchers as $matcher) { - $this->assertInstanceOf('\Hamcrest\Matcher', $matcher); -From e3b7bfcda4bc88f94e7f37f2a3a3380d4944735d Mon Sep 17 00:00:00 2001 -From: Fabien Villepinte -Date: Fri, 3 May 2024 15:50:55 +0200 -Subject: [PATCH] Allow installation of PHPUnit 9 in order to test with PHP 8.3 - ---- - .github/workflows/tests.yml | 1 + - composer.json | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml -index 68b483587..de0cfff6f 100644 ---- a/.github/workflows/tests.yml -+++ b/.github/workflows/tests.yml -@@ -23,6 +23,7 @@ jobs: - - '8.0' - - '8.1' - - '8.2' -+ - '8.3' - - name: PHP ${{ matrix.php }} - -diff --git a/composer.json b/composer.json -index 180f341d8..c89b279e1 100644 ---- a/composer.json -+++ b/composer.json -@@ -19,8 +19,8 @@ - }, - - "require-dev": { -- "phpunit/php-file-iterator": "^1.4 || ^2.0", -- "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0" -+ "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", -+ "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - - "replace": { From 76ce466b4db6fa58b16d69d28c7b724957b8479e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 05:12:46 +0000 Subject: [PATCH 14/14] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- php-hamcrest2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-hamcrest2.spec b/php-hamcrest2.spec index b61484b..d041f07 100644 --- a/php-hamcrest2.spec +++ b/php-hamcrest2.spec @@ -17,7 +17,7 @@ Name: php-hamcrest2 Version: 2.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: PHP port of Hamcrest Matchers License: BSD-3-Clause @@ -117,6 +117,9 @@ exit $ret %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 2.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue May 6 2025 Remi Collet - 2.1.1-1 - update to 2.1.1 - raise dependency on PHP 7.4