From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 12 Feb 2025 21:57:34 +0100
Subject: Compatibility with recent PHPUnit (12)

---
 tests/HttpClient/AwsRetryStrategyTest.php  | 2 ++
 tests/Unit/ConfigurationTest.php           | 2 ++
 tests/Unit/Signer/SignerV4Test.php         | 3 ++-
 tests/Unit/Stream/CallableStreamTest.php   | 4 ++++
 tests/Unit/Stream/FixedSizeStreamTest.php  | 5 +++++
 tests/Unit/Stream/IterableStreamTest.php   | 4 ++++
 tests/Unit/Stream/ResourceStreamTest.php   | 4 ++++
 tests/Unit/Stream/RewindableStreamTest.php | 4 ++++
 tests/Unit/Stream/StringStreamTest.php     | 4 ++++
 9 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tests/HttpClient/AwsRetryStrategyTest.php b/tests/HttpClient/AwsRetryStrategyTest.php
index bccae03..0315729 100644
--- a/tests/HttpClient/AwsRetryStrategyTest.php
+++ b/tests/HttpClient/AwsRetryStrategyTest.php
@@ -4,6 +4,7 @@ namespace AsyncAws\Core\Tests\HttpClient;
 
 use AsyncAws\Core\HttpClient\AwsRetryStrategy;
 use AsyncAws\Core\Test\TestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Symfony\Component\HttpClient\MockHttpClient;
 use Symfony\Component\HttpClient\Response\AsyncContext;
 use Symfony\Component\HttpClient\Response\MockResponse;
@@ -14,6 +15,7 @@ class AwsRetryStrategyTest extends TestCase
     /**
      * @dataProvider provideRetries
      */
+    #[DataProvider('provideRetries')]
     public function testShoudRetry(?bool $expected, int $statusCode, ?string $response): void
     {
         if (!class_exists(GenericRetryStrategy::class)) {
diff --git a/tests/Unit/ConfigurationTest.php b/tests/Unit/ConfigurationTest.php
index c5b96ca..90fb5b1 100644
--- a/tests/Unit/ConfigurationTest.php
+++ b/tests/Unit/ConfigurationTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace AsyncAws\Core\Tests\Unit;
 
 use AsyncAws\Core\Configuration;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class ConfigurationTest extends TestCase
@@ -12,6 +13,7 @@ class ConfigurationTest extends TestCase
     /**
      * @dataProvider provideConfiguration
      */
+    #[DataProvider('provideConfiguration')]
     public function testCreate($config, $env, $expected)
     {
         foreach ($env as $key => $value) {
diff --git a/tests/Unit/Signer/SignerV4Test.php b/tests/Unit/Signer/SignerV4Test.php
index fe42964..e6218ca 100644
--- a/tests/Unit/Signer/SignerV4Test.php
+++ b/tests/Unit/Signer/SignerV4Test.php
@@ -9,6 +9,7 @@ use AsyncAws\Core\Request;
 use AsyncAws\Core\RequestContext;
 use AsyncAws\Core\Signer\SignerV4;
 use AsyncAws\Core\Stream\StringStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class SignerV4Test extends TestCase
@@ -63,6 +64,7 @@ class SignerV4Test extends TestCase
     /**
      * @dataProvider provideRequests
      */
+    #[DataProvider('provideRequests')]
     public function testSignsRequests($rawRequest, $rawExpected)
     {
         $request = $this->parseRequest($rawRequest);
@@ -130,7 +132,6 @@ class SignerV4Test extends TestCase
             [
                 "POST / HTTP/1.1\r\nHost: host.foo.com:443\r\nContent-Length: 4\r\n\r\nTest",
                 "POST / HTTP/1.1\r\nHost: host.foo.com:443\r\nContent-Length: 4\r\nX-Amz-Date: 20110909T233600Z\r\nAuthorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=host;x-amz-date, Signature=e971be49c79358595ef6214f683ac9c0489d397a5d5d13b361291e751deeca03\r\n\r\nTest",
-                "POST\n/\n\nhost:host.foo.com:443\n\nhost\n532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25",
             ],
             // DateHeader should be kept
             [
diff --git a/tests/Unit/Stream/CallableStreamTest.php b/tests/Unit/Stream/CallableStreamTest.php
index dcfce89..0c5af79 100644
--- a/tests/Unit/Stream/CallableStreamTest.php
+++ b/tests/Unit/Stream/CallableStreamTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace AsyncAws\Core\Tests\Unit\Stream;
 
 use AsyncAws\Core\Stream\CallableStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class CallableStreamTest extends TestCase
@@ -12,6 +13,7 @@ class CallableStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength(callable $content, ?int $expected): void
     {
         $stream = CallableStream::create($content);
@@ -22,6 +24,7 @@ class CallableStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify(callable $content, string $expected): void
     {
         $stream = CallableStream::create($content);
@@ -32,6 +35,7 @@ class CallableStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk(callable $content, array $expected): void
     {
         $stream = CallableStream::create($content);
diff --git a/tests/Unit/Stream/FixedSizeStreamTest.php b/tests/Unit/Stream/FixedSizeStreamTest.php
index a8cec77..92e495d 100644
--- a/tests/Unit/Stream/FixedSizeStreamTest.php
+++ b/tests/Unit/Stream/FixedSizeStreamTest.php
@@ -9,6 +9,7 @@ use AsyncAws\Core\Stream\FixedSizeStream;
 use AsyncAws\Core\Stream\IterableStream;
 use AsyncAws\Core\Stream\RequestStream;
 use AsyncAws\Core\Stream\StringStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class FixedSizeStreamTest extends TestCase
@@ -16,6 +17,7 @@ class FixedSizeStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength(RequestStream $content, ?int $expected): void
     {
         $stream = FixedSizeStream::create($content);
@@ -26,6 +28,7 @@ class FixedSizeStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify(RequestStream $content, string $expected): void
     {
         $stream = FixedSizeStream::create($content);
@@ -36,6 +39,7 @@ class FixedSizeStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk(RequestStream $content, int $size, array $expected): void
     {
         $stream = FixedSizeStream::create($content, $size);
@@ -46,6 +50,7 @@ class FixedSizeStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testDecoratingFixedSize(RequestStream $content, int $size, array $expected): void
     {
         $stream = FixedSizeStream::create(FixedSizeStream::create($content, 5), $size);
diff --git a/tests/Unit/Stream/IterableStreamTest.php b/tests/Unit/Stream/IterableStreamTest.php
index e43cdbf..d9e36f6 100644
--- a/tests/Unit/Stream/IterableStreamTest.php
+++ b/tests/Unit/Stream/IterableStreamTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace AsyncAws\Core\Tests\Unit\Stream;
 
 use AsyncAws\Core\Stream\IterableStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class IterableStreamTest extends TestCase
@@ -12,6 +13,7 @@ class IterableStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength(iterable $content, ?int $expected): void
     {
         $stream = IterableStream::create($content);
@@ -22,6 +24,7 @@ class IterableStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify(iterable $content, string $expected): void
     {
         $stream = IterableStream::create($content);
@@ -32,6 +35,7 @@ class IterableStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk(iterable $content, array $expected): void
     {
         $stream = IterableStream::create($content);
diff --git a/tests/Unit/Stream/ResourceStreamTest.php b/tests/Unit/Stream/ResourceStreamTest.php
index b97bc36..0380776 100644
--- a/tests/Unit/Stream/ResourceStreamTest.php
+++ b/tests/Unit/Stream/ResourceStreamTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace AsyncAws\Core\Tests\Unit\Stream;
 
 use AsyncAws\Core\Stream\ResourceStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class ResourceStreamTest extends TestCase
@@ -12,6 +13,7 @@ class ResourceStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength($content, ?int $expected): void
     {
         $stream = ResourceStream::create($content);
@@ -22,6 +24,7 @@ class ResourceStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify($content, string $expected): void
     {
         $stream = ResourceStream::create($content);
@@ -32,6 +35,7 @@ class ResourceStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk($content, int $size, array $expected): void
     {
         $stream = ResourceStream::create($content, $size);
diff --git a/tests/Unit/Stream/RewindableStreamTest.php b/tests/Unit/Stream/RewindableStreamTest.php
index 2bc5242..d14257f 100644
--- a/tests/Unit/Stream/RewindableStreamTest.php
+++ b/tests/Unit/Stream/RewindableStreamTest.php
@@ -9,6 +9,7 @@ use AsyncAws\Core\Stream\IterableStream;
 use AsyncAws\Core\Stream\RequestStream;
 use AsyncAws\Core\Stream\RewindableStream;
 use AsyncAws\Core\Stream\StringStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class RewindableStreamTest extends TestCase
@@ -16,6 +17,7 @@ class RewindableStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength(RequestStream $content, ?int $expected): void
     {
         $stream = RewindableStream::create($content);
@@ -26,6 +28,7 @@ class RewindableStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify(RequestStream $content, string $expected): void
     {
         $stream = RewindableStream::create($content);
@@ -36,6 +39,7 @@ class RewindableStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk(RequestStream $content, array $expected): void
     {
         $stream = RewindableStream::create($content);
diff --git a/tests/Unit/Stream/StringStreamTest.php b/tests/Unit/Stream/StringStreamTest.php
index 80aed35..6dcf80f 100644
--- a/tests/Unit/Stream/StringStreamTest.php
+++ b/tests/Unit/Stream/StringStreamTest.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace AsyncAws\Core\Tests\Unit\Stream;
 
 use AsyncAws\Core\Stream\StringStream;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class StringStreamTest extends TestCase
@@ -12,6 +13,7 @@ class StringStreamTest extends TestCase
     /**
      * @dataProvider provideLengths
      */
+    #[DataProvider('provideLengths')]
     public function testLength(string $content, ?int $expected): void
     {
         $stream = StringStream::create($content);
@@ -22,6 +24,7 @@ class StringStreamTest extends TestCase
     /**
      * @dataProvider provideStrings
      */
+    #[DataProvider('provideStrings')]
     public function testStringify(string $content, string $expected): void
     {
         $stream = StringStream::create($content);
@@ -32,6 +35,7 @@ class StringStreamTest extends TestCase
     /**
      * @dataProvider provideChunks
      */
+    #[DataProvider('provideChunks')]
     public function testChunk(string $content, array $expected): void
     {
         $stream = StringStream::create($content);
