From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sat, 28 Dec 2024 02:34:21 +0100
Subject: Make provider functions static (PHPUnit 11 Fix)

Bug-Debian: https://bugs.debian.org/1070517
---
 tests/Functional/Channel/ChannelTimeoutTest.php      |  2 +-
 tests/Functional/Channel/ChannelWaitTest.php         |  6 +++---
 .../Functional/Connection/ConnectionCreationTest.php |  2 +-
 tests/Functional/Connection/SSLConnectionTest.php    |  4 +++-
 tests/Unit/Channel/AMQPChannelTest.php               |  2 +-
 tests/Unit/Connection/AMQPConnectionConfigTest.php   |  2 ++
 tests/Unit/Helper/MiscHelperTest.php                 |  4 ++--
 tests/Unit/Message/AMQPMessageTest.php               |  2 +-
 tests/Unit/WireTest.php                              | 20 ++++++++++----------
 9 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/tests/Functional/Channel/ChannelTimeoutTest.php b/tests/Functional/Channel/ChannelTimeoutTest.php
index 1c991d1..eec40fc 100644
--- a/tests/Functional/Channel/ChannelTimeoutTest.php
+++ b/tests/Functional/Channel/ChannelTimeoutTest.php
@@ -78,7 +78,7 @@ class ChannelTimeoutTest extends TestCaseCompat
         call_user_func_array(array($this->channel, $operation), $args);
     }
 
-    public function provide_operations()
+    public static function provide_operations()
     {
         return array(
             array('exchange_declare', array('test_ex', 'fanout')),
diff --git a/tests/Functional/Channel/ChannelWaitTest.php b/tests/Functional/Channel/ChannelWaitTest.php
index c4a0839..9bfa99a 100644
--- a/tests/Functional/Channel/ChannelWaitTest.php
+++ b/tests/Functional/Channel/ChannelWaitTest.php
@@ -19,7 +19,7 @@ class ChannelWaitTest extends TestCase
      * @test
      * @small
      * @group signals
-     * @dataProvider provide_channels
+     * @group nophpunit11
      * @param callable $factory
      */
     public function should_wait_until_signal_by_default($factory)
@@ -69,7 +69,7 @@ class ChannelWaitTest extends TestCase
     /**
      * @test
      * @small
-     * @dataProvider provide_channels
+     * @group nophpunit11
      * @param callable $factory
      */
     public function should_throw_timeout_exception($factory)
@@ -84,7 +84,7 @@ class ChannelWaitTest extends TestCase
     /**
      * @test
      * @small
-     * @dataProvider provide_channels
+     * @group nophpunit11
      * @param callable $factory
      */
     public function should_return_instantly_non_blocking($factory)
diff --git a/tests/Functional/Connection/ConnectionCreationTest.php b/tests/Functional/Connection/ConnectionCreationTest.php
index a6fb546..ada531b 100644
--- a/tests/Functional/Connection/ConnectionCreationTest.php
+++ b/tests/Functional/Connection/ConnectionCreationTest.php
@@ -13,7 +13,7 @@ use PhpAmqpLib\Wire\AMQPWriter;
  */
 class ConnectionCreationTest extends AbstractConnectionTestCase
 {
-    public function hostDataProvider(): array
+    public static function hostDataProvider(): array
     {
         return array(
             'plain' => array(
diff --git a/tests/Functional/Connection/SSLConnectionTest.php b/tests/Functional/Connection/SSLConnectionTest.php
index d2d2542..831b3e4 100644
--- a/tests/Functional/Connection/SSLConnectionTest.php
+++ b/tests/Functional/Connection/SSLConnectionTest.php
@@ -12,6 +12,7 @@ class SSLConnectionTest extends AbstractConnectionTestCase
 {
     /**
      * @test
+     * @group nophpunit11
      * @dataProvider secure_connection_params
      */
     public function secure_connection_default_params($options)
@@ -28,6 +29,7 @@ class SSLConnectionTest extends AbstractConnectionTestCase
 
     /**
      * @test
+     * @group nophpunit11
      * @dataProvider secure_connection_params
      */
     public function secure_connection_default_params_with_keepalive($options)
@@ -36,7 +38,7 @@ class SSLConnectionTest extends AbstractConnectionTestCase
         $this->secure_connection_default_params($options);
     }
 
-    public function secure_connection_params()
+    public static function secure_connection_params()
     {
         $sets = [];
 
diff --git a/tests/Unit/Channel/AMQPChannelTest.php b/tests/Unit/Channel/AMQPChannelTest.php
index 28f6f2a..dda33e7 100644
--- a/tests/Unit/Channel/AMQPChannelTest.php
+++ b/tests/Unit/Channel/AMQPChannelTest.php
@@ -166,7 +166,7 @@ class AMQPChannelTest extends TestCase
         $this->assertFalse($secondResult);
     }
 
-    public function basic_consume_invalid_arguments_provider()
+    public static function basic_consume_invalid_arguments_provider()
     {
         return [
             [
diff --git a/tests/Unit/Connection/AMQPConnectionConfigTest.php b/tests/Unit/Connection/AMQPConnectionConfigTest.php
index 32e9bf4..7eb8ee6 100644
--- a/tests/Unit/Connection/AMQPConnectionConfigTest.php
+++ b/tests/Unit/Connection/AMQPConnectionConfigTest.php
@@ -75,6 +75,7 @@ class AMQPConnectionConfigTest extends TestCase
 
     /**
      * @test
+     * @group nophpunit11
      */
     public function secure_with_correct_crypto_method()
     {
@@ -103,6 +104,7 @@ class AMQPConnectionConfigTest extends TestCase
     }
 
     /**
+     * @group nophpunit11
      * @test
      */
     public function insecure_connection()
diff --git a/tests/Unit/Helper/MiscHelperTest.php b/tests/Unit/Helper/MiscHelperTest.php
index 74e24a3..bf28eca 100644
--- a/tests/Unit/Helper/MiscHelperTest.php
+++ b/tests/Unit/Helper/MiscHelperTest.php
@@ -33,7 +33,7 @@ class MiscHelperTest extends TestCaseCompat
         self::assertEquals('test', MiscHelper::methodSig('test'));
     }
 
-    public function splitSecondsMicrosecondsData(): array
+    public static function splitSecondsMicrosecondsData(): array
     {
         return [
             [0, [0, 0]],
@@ -50,7 +50,7 @@ class MiscHelperTest extends TestCaseCompat
         ];
     }
 
-    public function hexdumpData(): array
+    public static function hexdumpData(): array
     {
         return [
             [['FM', false, false, true], '/000\s+46 4d\s+FM/'],
diff --git a/tests/Unit/Message/AMQPMessageTest.php b/tests/Unit/Message/AMQPMessageTest.php
index 11a87c3..2d5b0a7 100644
--- a/tests/Unit/Message/AMQPMessageTest.php
+++ b/tests/Unit/Message/AMQPMessageTest.php
@@ -68,7 +68,7 @@ class AMQPMessageTest extends TestCase
         $message->getDeliveryTag();
     }
 
-    public function propertiesData()
+    public static function propertiesData()
     {
         return [
             [
diff --git a/tests/Unit/WireTest.php b/tests/Unit/WireTest.php
index ca4b991..e7aecc5 100644
--- a/tests/Unit/WireTest.php
+++ b/tests/Unit/WireTest.php
@@ -462,7 +462,7 @@ class WireTest extends TestCaseCompat
         );
     }
 
-    public function bitWrData()
+    public static function bitWrData()
     {
         return [
             [true],
@@ -470,7 +470,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function octetWrData()
+    public static function octetWrData()
     {
         $data = [];
         for ($i = 0; $i <= 255; $i++) {
@@ -480,7 +480,7 @@ class WireTest extends TestCaseCompat
         return $data;
     }
 
-    public function signedOctetWrData()
+    public static function signedOctetWrData()
     {
         $data = [];
         for ($i = -128; $i <= 127; $i++) {
@@ -490,7 +490,7 @@ class WireTest extends TestCaseCompat
         return $data;
     }
 
-    public function signedShortWrData()
+    public static function signedShortWrData()
     {
         return [
             [-32768],
@@ -500,7 +500,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function longWrData()
+    public static function longWrData()
     {
         $max = PHP_INT_SIZE === 8 ? 4294967295 : PHP_INT_MAX;
 
@@ -525,7 +525,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function signedLongWrData()
+    public static function signedLongWrData()
     {
         return [
             [-2147483648],
@@ -551,7 +551,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function longlongWrData()
+    public static function longlongWrData()
     {
         return [
             [0],
@@ -577,7 +577,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function signedLonglongWrData()
+    public static function signedLonglongWrData()
     {
         $min = defined('PHP_INT_MIN') ? PHP_INT_MIN : ~PHP_INT_MAX;
         return [
@@ -617,7 +617,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function shortstrWrData()
+    public static function shortstrWrData()
     {
         return [
             ['a'],
@@ -625,7 +625,7 @@ class WireTest extends TestCaseCompat
         ];
     }
 
-    public function longstrWrData()
+    public static function longstrWrData()
     {
         return [
             ['a'],
