Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Migrate to `static` data providers using `rector/rector`
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents 3f7467b + 5638d82 commit 4ff4988
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Tests/Controller/ProfilerControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function testToolbarActionWithEmptyToken($token)
$this->assertEquals(200, $response->getStatusCode());
}

public function getEmptyTokenCases()
public static function getEmptyTokenCases()
{
return [
[null],
Expand Down Expand Up @@ -165,7 +165,7 @@ public function testOpeningDisallowedPaths($path, $isAllowed)
}
}

public function getOpenFileCases()
public static function getOpenFileCases()
{
return [
['README.md', true],
Expand Down Expand Up @@ -355,7 +355,7 @@ public function testPhpinfoAction()
$this->assertStringContainsString('PHP License', $client->getResponse()->getContent());
}

public function provideCspVariants()
public static function provideCspVariants()
{
return [
[true],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Csp/ContentSecurityPolicyHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testOnKernelResponse($nonce, $expectedNonce, Request $request, R
}
}

public function provideRequestAndResponses()
public static function provideRequestAndResponses()
{
$nonce = bin2hex(random_bytes(16));

Expand All @@ -73,7 +73,7 @@ public function provideRequestAndResponses()
];
}

public function provideRequestAndResponsesForOnKernelResponse()
public static function provideRequestAndResponsesForOnKernelResponse()
{
$nonce = bin2hex(random_bytes(16));

Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testConfigTree(array $options, array $expectedResult)
$this->assertEquals($expectedResult, $config);
}

public function getDebugModes()
public static function getDebugModes()
{
return [
[
Expand Down Expand Up @@ -71,7 +71,7 @@ public function testConfigTreeUsingInterceptRedirects(bool $interceptRedirects,
$this->assertEquals($expectedResult, $config);
}

public function getInterceptRedirectsConfiguration()
public static function getInterceptRedirectsConfiguration()
{
return [
[
Expand Down
6 changes: 3 additions & 3 deletions Tests/DependencyInjection/WebProfilerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testDefaultConfig($debug)
self::assertSaneContainer($this->getCompiledContainer());
}

public function getDebugModes()
public static function getDebugModes()
{
return [
['debug' => false],
Expand All @@ -129,7 +129,7 @@ public function testToolbarConfig(bool $toolbarEnabled, bool $listenerInjected,
}
}

public function getToolbarConfig()
public static function getToolbarConfig()
{
return [
[
Expand Down Expand Up @@ -170,7 +170,7 @@ public function testToolbarConfigUsingInterceptRedirects(
}
}

public function getInterceptRedirectsToolbarConfig()
public static function getInterceptRedirectsToolbarConfig()
{
return [
[
Expand Down
4 changes: 2 additions & 2 deletions Tests/EventListener/WebDebugToolbarListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testInjectToolbar($content, $expected)
$this->assertEquals($expected, $response->getContent());
}

public function getInjectToolbarTests()
public static function getInjectToolbarTests()
{
return [
['<html><head></head><body></body></html>', "<html><head></head><body>\nWDT\n</body></html>"],
Expand Down Expand Up @@ -147,7 +147,7 @@ public function testToolbarIsNotInjectedOnRedirection($statusCode)
$this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
}

public function provideRedirects()
public static function provideRedirects()
{
return [
[301],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Resources/IconTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testIconFileContents($iconFilePath)
$this->assertMatchesRegularExpression('~<svg .* viewBox="0 0 \d+ \d+".+>.*</svg>~s', file_get_contents($iconFilePath), sprintf('The SVG file of the "%s" icon must include a "viewBox" attribute.', $iconFilePath));
}

public function provideIconFilePaths()
public static function provideIconFilePaths()
{
return array_map(function ($filePath) { return (array) $filePath; }, glob(__DIR__.'/../../Resources/views/Icon/*.svg'));
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Twig/WebProfilerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class_exists(EscaperExtension::class); // Load twig_escape_filter()
self::assertSame($dump2HasHeader, str_contains($dump2, $needle));
}

public function provideMessages(): iterable
public static function provideMessages(): iterable
{
yield ['Some message', ['foo' => 'foo', 'bar' => 'bar'], false, true];
yield ['Some message {@see some text}', ['foo' => 'foo', 'bar' => 'bar'], false, true];
Expand Down

0 comments on commit 4ff4988

Please sign in to comment.