Skip to content

Commit b794723

Browse files
Merge branch '5.4' into 6.2
* 5.4: Migrate to `static` data providers using `rector/rector`
2 parents dd9b759 + 934dd9f commit b794723

22 files changed

+32
-32
lines changed

Tests/Controller/ArgumentResolver/BackedEnumValueResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testSupports(Request $request, ArgumentMetadata $metadata, bool
3636
self::assertSame($expectedSupport, $resolver->supports($request, $metadata));
3737
}
3838

39-
public function provideTestSupportsData(): iterable
39+
public static function provideTestSupportsData(): iterable
4040
{
4141
yield 'unsupported type' => [
4242
self::createRequest(['suit' => 'H']),
@@ -85,7 +85,7 @@ public function testResolve(Request $request, ArgumentMetadata $metadata, $expec
8585
self::assertSame($expected, $results);
8686
}
8787

88-
public function provideTestResolveData(): iterable
88+
public static function provideTestResolveData(): iterable
8989
{
9090
yield 'resolves from attributes' => [
9191
self::createRequest(['suit' => 'H']),

Tests/Controller/ArgumentResolver/UidValueResolverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testSupports(bool $expected, Request $request, ArgumentMetadata
3939
$this->assertSame($expected, (new UidValueResolver())->supports($request, $argument));
4040
}
4141

42-
public function provideSupports()
42+
public static function provideSupports()
4343
{
4444
return [
4545
'Variadic argument' => [false, new Request([], [], ['foo' => (string) $uuidV4 = new UuidV4()]), new ArgumentMetadata('foo', UuidV4::class, true, false, null)],
@@ -67,7 +67,7 @@ public function testResolveOK(AbstractUid $expected, string $requestUid)
6767
));
6868
}
6969

70-
public function provideResolveOK()
70+
public static function provideResolveOK()
7171
{
7272
return [
7373
[$uuidV1 = new UuidV1(), (string) $uuidV1],
@@ -96,7 +96,7 @@ public function testResolveKO(string $requestUid, string $argumentType)
9696
);
9797
}
9898

99-
public function provideResolveKO()
99+
public static function provideResolveKO()
100100
{
101101
return [
102102
'Bad value for UUID' => ['ccc', UuidV1::class],

Tests/Controller/ContainerControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testInstantiateControllerWhenControllerStartsWithABackslash($con
116116
$this->assertSame('action', $controller[1]);
117117
}
118118

119-
public function getControllers()
119+
public static function getControllers()
120120
{
121121
return [
122122
['\\'.ControllerTestService::class.'::action'],

Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function testGetControllerWithStaticController($staticController, $return
141141
$this->assertSame($returnValue, $controller());
142142
}
143143

144-
public function getStaticControllers()
144+
public static function getStaticControllers()
145145
{
146146
return [
147147
[TestAbstractController::class.'::staticAction', 'foo'],

Tests/Controller/ErrorControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testInvokeController(Request $request, \Exception $exception, in
3636
self::assertStringContainsString($content, strtr($response->getContent(), ["\n" => '', ' ' => '']));
3737
}
3838

39-
public function getInvokeControllerDataProvider()
39+
public static function getInvokeControllerDataProvider()
4040
{
4141
yield 'default status code and HTML format' => [
4242
new Request(),

Tests/DataCollector/LoggerDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function testReset()
179179
$c->reset();
180180
}
181181

182-
public function getCollectTestData()
182+
public static function getCollectTestData()
183183
{
184184
yield 'simple log' => [
185185
1,

Tests/DataCollector/MemoryDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testBytesConversion($limit, $bytes)
3636
$this->assertEquals($bytes, $method->invoke($collector, $limit));
3737
}
3838

39-
public function getBytesConversionTestData()
39+
public static function getBytesConversionTestData()
4040
{
4141
return [
4242
['2k', 2048],

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function testBindings($bindingName)
309309
$this->assertEquals($expected, $locator->getArgument(0));
310310
}
311311

312-
public function provideBindings()
312+
public static function provideBindings()
313313
{
314314
return [
315315
[ControllerDummy::class.'$bar'],
@@ -344,7 +344,7 @@ public function testBindScalarValueToControllerArgument($bindingKey)
344344
$this->assertSame('foo_val', $locator->get('foo::fooAction')->get('someArg'));
345345
}
346346

347-
public function provideBindScalarValueToControllerArgument()
347+
public static function provideBindScalarValueToControllerArgument()
348348
{
349349
yield ['$someArg'];
350350
yield ['string $someArg'];

Tests/Event/ControllerEventTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testGetAttributes(callable $controller)
3838
$this->assertEquals($expected, $event->getAttributes());
3939
}
4040

41-
public function provideGetAttributes()
41+
public static function provideGetAttributes()
4242
{
4343
yield [[new AttributeController(), '__invoke']];
4444
yield [new AttributeController()];

Tests/EventListener/DebugHandlersListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function testReplaceExistingExceptionHandler()
154154
$this->assertSame($userHandler, $eHandler->setExceptionHandler('var_dump'));
155155
}
156156

157-
public function provideLevelsAssignedToLoggers(): array
157+
public static function provideLevelsAssignedToLoggers(): array
158158
{
159159
return [
160160
[false, false, '0', null, null],

Tests/EventListener/DisallowRobotsIndexingListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testInvoke(?string $expected, array $responseArgs)
3636
$this->assertSame($expected, $response->headers->get('X-Robots-Tag'), 'Header doesn\'t match expectations');
3737
}
3838

39-
public function provideResponses(): iterable
39+
public static function provideResponses(): iterable
4040
{
4141
yield 'No header' => ['noindex', []];
4242

Tests/EventListener/ErrorListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function testHandleWithLoggerAndCustomConfiguration()
117117
$this->assertCount(1, $logger->getLogs('warning'));
118118
}
119119

120-
public function provider()
120+
public static function provider()
121121
{
122122
if (!class_exists(Request::class)) {
123123
return [[null, null]];
@@ -200,7 +200,7 @@ public function testOnControllerArguments(callable $controller)
200200
$this->assertSame('OK: foo', $event->getResponse()->getContent());
201201
}
202202

203-
public function controllerProvider()
203+
public static function controllerProvider()
204204
{
205205
yield [function (FlattenException $exception) {
206206
return new Response('OK: '.$exception->getMessage());

Tests/EventListener/ProfilerListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testCollectParameter(Request $request, ?bool $enable)
8787
$listener->onKernelResponse(new ResponseEvent($kernel, $request, Kernel::MAIN_REQUEST, $response));
8888
}
8989

90-
public function collectRequestProvider(): iterable
90+
public static function collectRequestProvider(): iterable
9191
{
9292
yield [Request::create('/'), null];
9393
yield [Request::create('/', 'GET', ['profile' => '1']), true];

Tests/EventListener/RouterListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testPort($defaultHttpPort, $defaultHttpsPort, $uri, $expectedHtt
6767
$this->assertEquals(str_starts_with($uri, 'https') ? 'https' : 'http', $context->getScheme());
6868
}
6969

70-
public function getPortData()
70+
public static function getPortData()
7171
{
7272
return [
7373
[80, 443, 'http://localhost/', 80, 443],
@@ -151,7 +151,7 @@ public function testLoggingParameter($parameter, $log, $parameters)
151151
$listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST));
152152
}
153153

154-
public function getLoggingParameterData()
154+
public static function getLoggingParameterData()
155155
{
156156
return [
157157
[['_route' => 'foo'], 'Matched route "{route}".', ['route' => 'foo', 'route_parameters' => ['_route' => 'foo'], 'request_uri' => 'http://localhost/', 'method' => 'GET']],

Tests/EventListener/SessionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testSessionCookieOptions(array $phpSessionOptions, array $sessio
8181
}
8282
}
8383

84-
public function provideSessionOptions(): \Generator
84+
public static function provideSessionOptions(): \Generator
8585
{
8686
yield 'set_samesite_by_php' => [
8787
'phpSessionOptions' => ['samesite' => Cookie::SAMESITE_STRICT],

Tests/Exception/HttpExceptionTest.php

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

1717
class HttpExceptionTest extends TestCase
1818
{
19-
public function headerDataProvider()
19+
public static function headerDataProvider()
2020
{
2121
return [
2222
[['X-Test' => 'Test']],

Tests/Fragment/RoutableFragmentRendererTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testGenerateAbsoluteFragmentUri($uri, $controller)
3434
$this->assertEquals('http://localhost'.$uri, $this->callGenerateFragmentUriMethod($controller, Request::create('/'), true));
3535
}
3636

37-
public function getGenerateFragmentUriData()
37+
public static function getGenerateFragmentUriData()
3838
{
3939
return [
4040
['/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', [], [])],
@@ -65,7 +65,7 @@ public function testGenerateFragmentUriWithNonScalar($controller)
6565
$this->callGenerateFragmentUriMethod($controller, Request::create('/'));
6666
}
6767

68-
public function getGenerateFragmentUriDataWithNonScalar()
68+
public static function getGenerateFragmentUriDataWithNonScalar()
6969
{
7070
return [
7171
[new ControllerReference('controller', ['foo' => new Foo(), 'bar' => 'bar'], [])],

Tests/HttpCache/HttpCacheTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ public function testHttpCacheIsSetAsATrustedProxy(array $existing)
14771477
Request::setTrustedProxies([], -1);
14781478
}
14791479

1480-
public function getTrustedProxyData()
1480+
public static function getTrustedProxyData()
14811481
{
14821482
return [
14831483
[[]],
@@ -1506,7 +1506,7 @@ public function testForwarderHeaderForForwardedRequests($forwarded, $expected)
15061506
Request::setTrustedProxies([], -1);
15071507
}
15081508

1509-
public function getForwardedData()
1509+
public static function getForwardedData()
15101510
{
15111511
return [
15121512
[null, 'for="10.0.0.1";host="localhost";proto=http'],
@@ -1698,7 +1698,7 @@ public function testResponsesThatMayBeUsedStaleIfError($responseHeaders, $sleepB
16981698
$this->assertTraceContains('stale-if-error');
16991699
}
17001700

1701-
public function getResponseDataThatMayBeServedStaleIfError()
1701+
public static function getResponseDataThatMayBeServedStaleIfError()
17021702
{
17031703
// All data sets assume that a 10s stale-if-error grace period has been configured
17041704
yield 'public, max-age expired' => [['Cache-Control' => 'public, max-age=60'], 65];
@@ -1740,7 +1740,7 @@ public function testResponsesThatMustNotBeUsedStaleIfError($responseHeaders, $sl
17401740
$this->assertEquals(500, $this->response->getStatusCode());
17411741
}
17421742

1743-
public function getResponseDataThatMustNotBeServedStaleIfError()
1743+
public static function getResponseDataThatMustNotBeServedStaleIfError()
17441744
{
17451745
// All data sets assume that a 10s stale-if-error grace period has been configured
17461746
yield 'public, no TTL but beyond grace period' => [['Cache-Control' => 'public'], 15];

Tests/HttpCache/ResponseCacheStrategyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testCacheControlMerging(array $expects, array $master, array $su
327327
}
328328
}
329329

330-
public function cacheControlMergingProvider()
330+
public static function cacheControlMergingProvider()
331331
{
332332
yield 'result is public if all responses are public' => [
333333
['private' => false, 'public' => true],

Tests/HttpKernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function testHandleWhenAnExceptionIsHandledWithASpecificStatusCode($expec
261261
$this->assertEquals($expectedStatusCode, $response->getStatusCode());
262262
}
263263

264-
public function getSpecificStatusCodes()
264+
public static function getSpecificStatusCodes()
265265
{
266266
return [
267267
[200],

Tests/KernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function testStripComments(string $source, string $expected)
256256
$this->assertEquals($expected, $output);
257257
}
258258

259-
public function getStripCommentsCodes(): array
259+
public static function getStripCommentsCodes(): array
260260
{
261261
return [
262262
['<?php echo foo();', '<?php echo foo();'],

Tests/Log/LoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testLogsAtAllLevels($level, $message)
8282
$this->assertLogsMatch($expected, $this->getLogs());
8383
}
8484

85-
public function provideLevelsAndMessages()
85+
public static function provideLevelsAndMessages()
8686
{
8787
return [
8888
LogLevel::EMERGENCY => [LogLevel::EMERGENCY, 'message of level emergency with context: {user}'],

0 commit comments

Comments
 (0)