From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sat, 30 Aug 2025 16:39:51 +0200
Subject: Compatibility with recent PHPUnit (12)

---
 tests/Hamcrest/Core/CombinableMatcherTest.php          | 6 +++---
 tests/Hamcrest/Core/IsInstanceOfTest.php               | 6 +++---
 tests/Hamcrest/Core/SetTest.php                        | 6 +++---
 tests/Hamcrest/FeatureMatcherTest.php                  | 6 +++---
 tests/Hamcrest/MatcherAssertTest.php                   | 5 ++---
 tests/Hamcrest/StringDescriptionTest.php               | 5 ++---
 tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php  | 6 +++---
 tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php | 6 +++---
 tests/Hamcrest/Text/StringContainsInOrderTest.php      | 6 +++---
 tests/Hamcrest/Text/StringContainsTest.php             | 6 +++---
 tests/Hamcrest/Text/StringEndsWithTest.php             | 6 +++---
 tests/Hamcrest/Text/StringStartsWithTest.php           | 6 +++---
 tests/Hamcrest/Xml/HasXPathTest.php                    | 6 +++---
 13 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/tests/Hamcrest/Core/CombinableMatcherTest.php b/tests/Hamcrest/Core/CombinableMatcherTest.php
index 96622ad..981bb60 100644
--- a/tests/Hamcrest/Core/CombinableMatcherTest.php
+++ b/tests/Hamcrest/Core/CombinableMatcherTest.php
@@ -1,15 +1,15 @@
 <?php
 namespace Hamcrest\Core;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class CombinableMatcherTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
     private $_either_3_or_4;
     private $_not_3_and_not_4;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4));
diff --git a/tests/Hamcrest/Core/IsInstanceOfTest.php b/tests/Hamcrest/Core/IsInstanceOfTest.php
index ed561c5..a054b9f 100644
--- a/tests/Hamcrest/Core/IsInstanceOfTest.php
+++ b/tests/Hamcrest/Core/IsInstanceOfTest.php
@@ -1,15 +1,15 @@
 <?php
 namespace Hamcrest\Core;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class IsInstanceOfTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
     private $_baseClassInstance;
     private $_subClassInstance;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good');
diff --git a/tests/Hamcrest/Core/SetTest.php b/tests/Hamcrest/Core/SetTest.php
index bb3c712..8449496 100644
--- a/tests/Hamcrest/Core/SetTest.php
+++ b/tests/Hamcrest/Core/SetTest.php
@@ -1,15 +1,15 @@
 <?php
 namespace Hamcrest\Core;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class SetTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
     public static $_classProperty;
     public $_instanceProperty;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         self::$_classProperty = null;
diff --git a/tests/Hamcrest/FeatureMatcherTest.php b/tests/Hamcrest/FeatureMatcherTest.php
index 4e4ad58..5483d0d 100644
--- a/tests/Hamcrest/FeatureMatcherTest.php
+++ b/tests/Hamcrest/FeatureMatcherTest.php
@@ -1,6 +1,8 @@
 <?php
 namespace Hamcrest;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class Thingy
 {
     private $_result;
@@ -34,9 +36,7 @@ class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTestCase
 
     private $_resultMatcher;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_resultMatcher = $this->_resultMatcher();
diff --git a/tests/Hamcrest/MatcherAssertTest.php b/tests/Hamcrest/MatcherAssertTest.php
index e349198..ccd26e9 100644
--- a/tests/Hamcrest/MatcherAssertTest.php
+++ b/tests/Hamcrest/MatcherAssertTest.php
@@ -1,14 +1,13 @@
 <?php
 namespace Hamcrest;
 
+use PHPUnit\Framework\Attributes\Before;
 use PHPUnit\Framework\TestCase;
 
 class MatcherAssertTest extends TestCase
 {
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         \Hamcrest\MatcherAssert::resetCount();
diff --git a/tests/Hamcrest/StringDescriptionTest.php b/tests/Hamcrest/StringDescriptionTest.php
index b42b9b4..414a6b6 100644
--- a/tests/Hamcrest/StringDescriptionTest.php
+++ b/tests/Hamcrest/StringDescriptionTest.php
@@ -1,6 +1,7 @@
 <?php
 namespace Hamcrest;
 
+use PHPUnit\Framework\Attributes\Before;
 use PHPUnit\Framework\TestCase;
 
 class SampleSelfDescriber implements \Hamcrest\SelfDescribing
@@ -23,9 +24,7 @@ class StringDescriptionTest extends TestCase
 
     private $_description;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_description = new \Hamcrest\StringDescription();
diff --git a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php
index 4a9ce68..536586c 100644
--- a/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php
+++ b/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php
@@ -1,14 +1,14 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class IsEqualIgnoringWhiteSpaceTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
     private $_matcher;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace(
diff --git a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php
index 1700d5d..692a25d 100644
--- a/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php
+++ b/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php
@@ -1,6 +1,8 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class StringContainsIgnoringCaseTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
@@ -8,9 +10,7 @@ class StringContainsIgnoringCaseTest extends \Hamcrest\AbstractMatcherTestCase
 
     private $_stringContains;
 
-    /**
-     * @before
-     */
+    #[Before]
     protected function setUpTest()
     {
         $this->_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase(
diff --git a/tests/Hamcrest/Text/StringContainsInOrderTest.php b/tests/Hamcrest/Text/StringContainsInOrderTest.php
index 45b8315..03d9c9d 100644
--- a/tests/Hamcrest/Text/StringContainsInOrderTest.php
+++ b/tests/Hamcrest/Text/StringContainsInOrderTest.php
@@ -1,14 +1,14 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class StringContainsInOrderTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
     private $_m;
 
-    /**
-     * @before
-     */
+    #[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 79d776c..cd31e7c 100644
--- a/tests/Hamcrest/Text/StringContainsTest.php
+++ b/tests/Hamcrest/Text/StringContainsTest.php
@@ -1,6 +1,8 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class StringContainsTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
@@ -8,9 +10,7 @@ class StringContainsTest extends \Hamcrest\AbstractMatcherTestCase
 
     private $_stringContains;
 
-    /**
-     * @before
-     */
+    #[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 7d0044f..fb8ca48 100644
--- a/tests/Hamcrest/Text/StringEndsWithTest.php
+++ b/tests/Hamcrest/Text/StringEndsWithTest.php
@@ -1,6 +1,8 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class StringEndsWithTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
@@ -8,9 +10,7 @@ class StringEndsWithTest extends \Hamcrest\AbstractMatcherTestCase
 
     private $_stringEndsWith;
 
-    /**
-     * @before
-     */
+    #[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 97581bf..46b9d79 100644
--- a/tests/Hamcrest/Text/StringStartsWithTest.php
+++ b/tests/Hamcrest/Text/StringStartsWithTest.php
@@ -1,6 +1,8 @@
 <?php
 namespace Hamcrest\Text;
 
+use PHPUnit\Framework\Attributes\Before;
+
 class StringStartsWithTest extends \Hamcrest\AbstractMatcherTestCase
 {
 
@@ -8,9 +10,7 @@ class StringStartsWithTest extends \Hamcrest\AbstractMatcherTestCase
 
     private $_stringStartsWith;
 
-    /**
-     * @before
-     */
+    #[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 eba2081..0c6adaf 100644
--- a/tests/Hamcrest/Xml/HasXPathTest.php
+++ b/tests/Hamcrest/Xml/HasXPathTest.php
@@ -1,15 +1,15 @@
 <?php
 namespace Hamcrest\Xml;
 
+use PHPUnit\Framework\Attributes\BeforeClass;
+
 class HasXPathTest extends \Hamcrest\AbstractMatcherTestCase
 {
     protected static $xml;
     protected static $doc;
     protected static $html;
 
-    /**
-     * @beforeClass
-     */
+    #[BeforeClass]
     public static function setUpBeforeClassTest()
     {
         self::$xml = <<<XML
