1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sun, 19 May 2024 11:58:41 +0200
Subject: Make provider functions static (PHPUnit 11 Fix)
Bug-Debian: https://bugs.debian.org/1070518
---
tests/HttpClient/AwsRetryStrategyTest.php | 2 +-
tests/Unit/ConfigurationTest.php | 2 +-
tests/Unit/Signer/SignerV4Test.php | 2 +-
tests/Unit/Stream/CallableStreamTest.php | 6 +++---
tests/Unit/Stream/FixedSizeStreamTest.php | 6 +++---
tests/Unit/Stream/IterableStreamTest.php | 6 +++---
tests/Unit/Stream/ResourceStreamTest.php | 6 +++---
tests/Unit/Stream/RewindableStreamTest.php | 6 +++---
tests/Unit/Stream/StringStreamTest.php | 6 +++---
9 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/tests/HttpClient/AwsRetryStrategyTest.php b/tests/HttpClient/AwsRetryStrategyTest.php
index a242b23..bccae03 100644
--- a/tests/HttpClient/AwsRetryStrategyTest.php
+++ b/tests/HttpClient/AwsRetryStrategyTest.php
@@ -25,7 +25,7 @@ class AwsRetryStrategyTest extends TestCase
self::assertSame($expected, $strategy->shouldRetry($context, $response, null));
}
- public function provideRetries(): iterable
+ public static function provideRetries(): iterable
{
yield [false, 200, null];
yield [true, 429, null];
diff --git a/tests/Unit/ConfigurationTest.php b/tests/Unit/ConfigurationTest.php
index e076a82..c5b96ca 100644
--- a/tests/Unit/ConfigurationTest.php
+++ b/tests/Unit/ConfigurationTest.php
@@ -61,7 +61,7 @@ class ConfigurationTest extends TestCase
self::assertNull($config->get('accessKeySecret'));
}
- public function provideConfiguration(): iterable
+ public static function provideConfiguration(): iterable
{
yield 'simple config' => [['endpoint' => 'foo'], [], ['endpoint' => 'foo']];
yield 'empty config' => [['endpoint' => ''], [], ['endpoint' => '']];
diff --git a/tests/Unit/Signer/SignerV4Test.php b/tests/Unit/Signer/SignerV4Test.php
index 495dfb7..fe42964 100644
--- a/tests/Unit/Signer/SignerV4Test.php
+++ b/tests/Unit/Signer/SignerV4Test.php
@@ -78,7 +78,7 @@ class SignerV4Test extends TestCase
self::assertEquals($expected, $request);
}
- public function provideRequests()
+ public static function provideRequests()
{
return [
// POST headers should be signed.
diff --git a/tests/Unit/Stream/CallableStreamTest.php b/tests/Unit/Stream/CallableStreamTest.php
index fb14d53..dcfce89 100644
--- a/tests/Unit/Stream/CallableStreamTest.php
+++ b/tests/Unit/Stream/CallableStreamTest.php
@@ -39,14 +39,14 @@ class CallableStreamTest extends TestCase
self::assertSame($expected, iterator_to_array($stream));
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
yield [function () {
return 'Hello world';
}, null];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
$f = static function (string ...$items) {
return static function () use (&$items) {
@@ -58,7 +58,7 @@ class CallableStreamTest extends TestCase
yield [$f('Hello', ' ', '', 'world'), 'Hello '];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
$f = static function (string ...$items) {
return static function () use (&$items) {
diff --git a/tests/Unit/Stream/FixedSizeStreamTest.php b/tests/Unit/Stream/FixedSizeStreamTest.php
index 85a585a..a8cec77 100644
--- a/tests/Unit/Stream/FixedSizeStreamTest.php
+++ b/tests/Unit/Stream/FixedSizeStreamTest.php
@@ -53,19 +53,19 @@ class FixedSizeStreamTest extends TestCase
self::assertSame($expected, iterator_to_array($stream));
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
yield [StringStream::create('Hello world'), 11];
yield [CallableStream::create(function () {}), null];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
yield [StringStream::create('Hello world'), 'Hello world'];
yield [IterableStream::create((function () { yield 'Hello world'; })()), 'Hello world'];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
yield [StringStream::create('Hello world'), 3, ['Hel', 'lo ', 'wor', 'ld']];
yield [IterableStream::create((function () {
diff --git a/tests/Unit/Stream/IterableStreamTest.php b/tests/Unit/Stream/IterableStreamTest.php
index 72dc3cd..e43cdbf 100644
--- a/tests/Unit/Stream/IterableStreamTest.php
+++ b/tests/Unit/Stream/IterableStreamTest.php
@@ -39,14 +39,14 @@ class IterableStreamTest extends TestCase
self::assertSame($expected, iterator_to_array($stream));
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
yield [(function () {
yield 'Hello world';
})(), null];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
yield [(function () {
yield 'Hello world';
@@ -65,7 +65,7 @@ class IterableStreamTest extends TestCase
})(), 'Hello world'];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
yield [(function () {
yield 'Hello world';
diff --git a/tests/Unit/Stream/ResourceStreamTest.php b/tests/Unit/Stream/ResourceStreamTest.php
index 86d5ddf..b97bc36 100644
--- a/tests/Unit/Stream/ResourceStreamTest.php
+++ b/tests/Unit/Stream/ResourceStreamTest.php
@@ -38,7 +38,7 @@ class ResourceStreamTest extends TestCase
self::assertSame($expected, iterator_to_array($stream));
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
$resource = fopen(__DIR__ . '/../../../LICENSE', 'r');
yield [$resource, 1099];
@@ -53,7 +53,7 @@ class ResourceStreamTest extends TestCase
yield [$resource, 11];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
$resource = fopen('php://temp', 'rw+');
fwrite($resource, 'Hello World');
@@ -65,7 +65,7 @@ class ResourceStreamTest extends TestCase
yield [$resource, 'Hello World'];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
$resource = fopen('php://temp', 'rw+');
fwrite($resource, 'Hello World');
diff --git a/tests/Unit/Stream/RewindableStreamTest.php b/tests/Unit/Stream/RewindableStreamTest.php
index fca7aac..2bc5242 100644
--- a/tests/Unit/Stream/RewindableStreamTest.php
+++ b/tests/Unit/Stream/RewindableStreamTest.php
@@ -60,19 +60,19 @@ class RewindableStreamTest extends TestCase
self::assertSame(2, $count);
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
yield [StringStream::create('Hello world'), 11];
yield [CallableStream::create(function () {}), null];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
yield [StringStream::create('Hello world'), 'Hello world'];
yield [IterableStream::create((function () { yield 'Hello world'; })()), 'Hello world'];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
yield [StringStream::create('Hello world'), ['Hello world']];
}
diff --git a/tests/Unit/Stream/StringStreamTest.php b/tests/Unit/Stream/StringStreamTest.php
index 2455beb..80aed35 100644
--- a/tests/Unit/Stream/StringStreamTest.php
+++ b/tests/Unit/Stream/StringStreamTest.php
@@ -39,19 +39,19 @@ class StringStreamTest extends TestCase
self::assertSame($expected, iterator_to_array($stream));
}
- public function provideLengths(): iterable
+ public static function provideLengths(): iterable
{
yield ['Hello world', 11];
yield ['H', 1];
yield ['é', 2];
}
- public function provideStrings(): iterable
+ public static function provideStrings(): iterable
{
yield ['Hello world', 'Hello world'];
}
- public function provideChunks(): iterable
+ public static function provideChunks(): iterable
{
yield ['Hello world', ['Hello world']];
}
|