Skip to content

Commit 9dfac80

Browse files
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
2 parents 0c2e735 + 2df0f57 commit 9dfac80

11 files changed

+21
-21
lines changed

Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function testItGeneratesCurlCommandsAsExpected(array $request, string $ex
179179
self::assertEquals(sprintf($expectedCurlCommand, '\\' === \DIRECTORY_SEPARATOR ? '"' : "'"), $curlCommand);
180180
}
181181

182-
public function provideCurlRequests(): iterable
182+
public static function provideCurlRequests(): iterable
183183
{
184184
yield 'GET' => [
185185
[

Tests/EventSourceHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function testContentType($contentType, $expected)
152152
}
153153
}
154154

155-
public function contentTypeProvider()
155+
public static function contentTypeProvider()
156156
{
157157
return [
158158
['text/event-stream', true],

Tests/Exception/HttpExceptionTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class HttpExceptionTraitTest extends TestCase
2222
{
23-
public function provideParseError(): iterable
23+
public static function provideParseError(): iterable
2424
{
2525
$errorWithoutMessage = 'HTTP/1.1 400 Bad Request returned for "http://example.com".';
2626

Tests/HttpClientTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ public function testRedirectWithAuth(string $url, bool $redirectWithAuth)
483483
}
484484
}
485485

486-
public function getRedirectWithAuthTests()
486+
public static function getRedirectWithAuthTests()
487487
{
488488
return [
489489
'same host and port' => ['url' => 'http://localhost:8057/302', 'redirectWithAuth' => true],

Tests/HttpClientTraitTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testPrepareRequestUrl(string $expected, string $url, array $quer
3737
$this->assertSame($expected, implode('', $url));
3838
}
3939

40-
public function providePrepareRequestUrl(): iterable
40+
public static function providePrepareRequestUrl(): iterable
4141
{
4242
yield ['http://example.com/', 'http://example.com/'];
4343
yield ['http://example.com/?a=1&b=b', '.'];
@@ -79,7 +79,7 @@ public function testResolveUrl(string $base, string $url, string $expected)
7979
/**
8080
* From https://github.com/guzzle/psr7/blob/master/tests/UriResoverTest.php.
8181
*/
82-
public function provideResolveUrl(): array
82+
public static function provideResolveUrl(): array
8383
{
8484
return [
8585
[self::RFC3986_BASE, 'http:h', 'http:h'],
@@ -167,7 +167,7 @@ public function testParseUrl(array $expected, string $url, array $query = [])
167167
$this->assertSame($expected, self::parseUrl($url, $query));
168168
}
169169

170-
public function provideParseUrl(): iterable
170+
public static function provideParseUrl(): iterable
171171
{
172172
yield [['http:', '//example.com', null, null, null], 'http://Example.coM:80'];
173173
yield [['https:', '//xn--dj-kia8a.example.com:8000', '/', null, null], 'https://DÉjà.Example.com:8000/'];
@@ -194,7 +194,7 @@ public function testRemoveDotSegments($expected, $url)
194194
$this->assertSame($expected, self::removeDotSegments($url));
195195
}
196196

197-
public function provideRemoveDotSegments()
197+
public static function provideRemoveDotSegments()
198198
{
199199
yield ['', ''];
200200
yield ['', '.'];
@@ -243,7 +243,7 @@ public function testSetJSONAndBodyOptions()
243243
self::prepareRequest('POST', 'http://example.com', ['json' => ['foo' => 'bar'], 'body' => '<html/>'], HttpClientInterface::OPTIONS_DEFAULTS);
244244
}
245245

246-
public function providePrepareAuthBasic()
246+
public static function providePrepareAuthBasic()
247247
{
248248
yield ['foo:bar', 'Zm9vOmJhcg=='];
249249
yield [['foo', 'bar'], 'Zm9vOmJhcg=='];
@@ -260,7 +260,7 @@ public function testPrepareAuthBasic($arg, $result)
260260
$this->assertSame('Authorization: Basic '.$result, $options['normalized_headers']['authorization'][0]);
261261
}
262262

263-
public function provideFingerprints()
263+
public static function provideFingerprints()
264264
{
265265
foreach (['md5', 'sha1', 'sha256'] as $algo) {
266266
$hash = hash($algo, $algo);

Tests/HttpOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class HttpOptionsTest extends TestCase
2121
{
22-
public function provideSetAuthBasic(): iterable
22+
public static function provideSetAuthBasic(): iterable
2323
{
2424
yield ['user:password', 'user', 'password'];
2525
yield ['user:password', 'user:password'];

Tests/MockHttpClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testMocking($factory, array $expectedResponses)
4242
$this->assertSame(2, $client->getRequestsCount());
4343
}
4444

45-
public function mockingProvider(): iterable
45+
public static function mockingProvider(): iterable
4646
{
4747
yield 'callable' => [
4848
static function (string $method, string $url, array $options = []) {
@@ -112,7 +112,7 @@ public function testValidResponseFactory($responseFactory)
112112
$this->addToAssertionCount(1);
113113
}
114114

115-
public function validResponseFactoryProvider()
115+
public static function validResponseFactoryProvider()
116116
{
117117
return [
118118
[static function (): MockResponse { return new MockResponse(); }],
@@ -138,7 +138,7 @@ public function testTransportExceptionThrowsIfPerformedMoreRequestsThanConfigure
138138
$client->request('POST', '/foo');
139139
}
140140

141-
public function transportExceptionProvider(): iterable
141+
public static function transportExceptionProvider(): iterable
142142
{
143143
yield 'array of callable' => [
144144
[
@@ -179,7 +179,7 @@ public function testInvalidResponseFactory($responseFactory, string $expectedExc
179179
(new MockHttpClient($responseFactory))->request('GET', 'https://foo.bar');
180180
}
181181

182-
public function invalidResponseFactoryProvider()
182+
public static function invalidResponseFactoryProvider()
183183
{
184184
return [
185185
[static function (): \Generator { yield new MockResponse(); }, 'The response factory passed to MockHttpClient must return/yield an instance of ResponseInterface, "Generator" given.'],

Tests/NoPrivateNetworkHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class NoPrivateNetworkHttpClientTest extends TestCase
2424
{
25-
public function getExcludeData(): array
25+
public static function getExcludeData(): array
2626
{
2727
return [
2828
// private

Tests/Response/MockResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testUrlHttpMethodMockResponse()
7575
$this->assertSame($url, $responseMock->getRequestUrl());
7676
}
7777

78-
public function toArrayErrors()
78+
public static function toArrayErrors()
7979
{
8080
yield [
8181
'content' => '',

Tests/Retry/GenericRetryStrategyTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public function testShouldNotRetry(string $method, int $code, ?TransportExceptio
4141
self::assertFalse($strategy->shouldRetry($this->getContext(0, $method, 'http://example.com/', $code), null, $exception));
4242
}
4343

44-
public function provideRetryable(): iterable
44+
public static function provideRetryable(): iterable
4545
{
4646
yield ['GET', 200, new TransportException()];
4747
yield ['GET', 500, null];
4848
yield ['POST', 429, null];
4949
}
5050

51-
public function provideNotRetryable(): iterable
51+
public static function provideNotRetryable(): iterable
5252
{
5353
yield ['POST', 200, null];
5454
yield ['POST', 200, new TransportException()];
@@ -65,7 +65,7 @@ public function testGetDelay(int $delay, int $multiplier, int $maxDelay, int $pr
6565
self::assertSame($expectedDelay, $strategy->getDelay($this->getContext($previousRetries, 'GET', 'http://example.com/', 200), null, null));
6666
}
6767

68-
public function provideDelay(): iterable
68+
public static function provideDelay(): iterable
6969
{
7070
// delay, multiplier, maxDelay, retries, expectedDelay
7171
yield [1000, 1, 5000, 0, 1000];

Tests/ScopingHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testMatchingUrls(string $regexp, string $url, array $options)
4949
$this->assertSame($options[$regexp]['case'], $requestedOptions['case']);
5050
}
5151

52-
public function provideMatchingUrls()
52+
public static function provideMatchingUrls()
5353
{
5454
$defaultOptions = [
5555
'.*/foo-bar' => ['case' => 1],

0 commit comments

Comments
 (0)