Skip to content

Commit 4ff8d7d

Browse files
OskarStarknicolas-grekas
authored andcommitted
Migrate to static data providers using rector/rector
1 parent fc7442b commit 4ff8d7d

15 files changed

+23
-23
lines changed

Tests/AppVariableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testDebug($debugFlag)
4343
$this->assertEquals($debugFlag, $this->appVariable->getDebug());
4444
}
4545

46-
public function debugDataProvider()
46+
public static function debugDataProvider()
4747
{
4848
return [
4949
'debug on' => [true],

Tests/Command/DebugCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testDebugTemplateName(array $input, string $output, array $paths
8484
$this->assertStringMatchesFormat($output, $tester->getDisplay(true));
8585
}
8686

87-
public function getDebugTemplateNameTestData()
87+
public static function getDebugTemplateNameTestData()
8888
{
8989
$defaultPaths = [
9090
'templates/' => null,
@@ -315,7 +315,7 @@ public function testComplete(array $input, array $expectedSuggestions)
315315
$this->assertSame($expectedSuggestions, $suggestions);
316316
}
317317

318-
public function provideCompletionSuggestions(): iterable
318+
public static function provideCompletionSuggestions(): iterable
319319
{
320320
yield 'name' => [['email'], []];
321321
yield 'option --format' => [['--format', ''], ['text', 'json']];

Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function testComplete(array $input, array $expectedSuggestions)
150150
$this->assertSame($expectedSuggestions, $tester->complete($input));
151151
}
152152

153-
public function provideCompletionSuggestions()
153+
public static function provideCompletionSuggestions()
154154
{
155155
yield 'option' => [['--format', ''], ['txt', 'json', 'github']];
156156
}

Tests/Extension/CodeExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public function testGettingMethodAbbreviation($method, $abbr)
4444
$this->assertEquals($this->getExtension()->abbrMethod($method), $abbr);
4545
}
4646

47-
public function getClassNameProvider(): array
47+
public static function getClassNameProvider(): array
4848
{
4949
return [
5050
['F\Q\N\Foo', '<abbr title="F\Q\N\Foo">Foo</abbr>'],
5151
['Bare', '<abbr title="Bare">Bare</abbr>'],
5252
];
5353
}
5454

55-
public function getMethodNameProvider(): array
55+
public static function getMethodNameProvider(): array
5656
{
5757
return [
5858
['F\Q\N\Foo::Method', '<abbr title="F\Q\N\Foo">Foo</abbr>::Method()'],

Tests/Extension/DumpExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testDumpTag($template, $debug, $expectedOutput, $expectedDumped)
5353
$this->assertSame($expectedDumped, $dumped);
5454
}
5555

56-
public function getDumpTags()
56+
public static function getDumpTags()
5757
{
5858
return [
5959
['A{% dump %}B', true, 'AB', []],
@@ -88,7 +88,7 @@ public function testDump($context, $args, $expectedOutput, $debug = true)
8888
$this->assertEquals($expectedOutput, $dump);
8989
}
9090

91-
public function getDumpArgs()
91+
public static function getDumpArgs()
9292
{
9393
return [
9494
[[], [], '', false],

Tests/Extension/FormExtensionDivLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testThemeBlockInheritanceUsingDynamicExtend()
100100
);
101101
}
102102

103-
public function isSelectedChoiceProvider()
103+
public static function isSelectedChoiceProvider()
104104
{
105105
return [
106106
[true, '0', '0'],
@@ -150,7 +150,7 @@ public function testStartTagHasActionAttributeWhenActionIsZero()
150150
$this->assertSame('<form name="form" method="get" action="0">', $html);
151151
}
152152

153-
public function isRootFormProvider()
153+
public static function isRootFormProvider()
154154
{
155155
return [
156156
[true, new FormView()],

Tests/Extension/HttpFoundationExtensionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testGenerateAbsoluteUrl($expected, $path, $pathinfo)
3232
$this->assertEquals($expected, $extension->generateAbsoluteUrl($path));
3333
}
3434

35-
public function getGenerateAbsoluteUrlData()
35+
public static function getGenerateAbsoluteUrlData()
3636
{
3737
return [
3838
['http://localhost/foo.png', '/foo.png', '/foo/bar.html'],
@@ -84,7 +84,7 @@ public function testGenerateAbsoluteUrlWithoutRequestAndRequestContext($path)
8484
$this->assertEquals($path, $extension->generateAbsoluteUrl($path));
8585
}
8686

87-
public function getGenerateAbsoluteUrlRequestContextData()
87+
public static function getGenerateAbsoluteUrlRequestContextData()
8888
{
8989
return [
9090
['/foo.png', '/foo', 'localhost', 'http', 80, 443, 'http://localhost/foo.png'],
@@ -129,7 +129,7 @@ public function testGenerateRelativePath($expected, $path, $pathinfo)
129129
$this->assertEquals($expected, $extension->generateRelativePath($path));
130130
}
131131

132-
public function getGenerateRelativePathData()
132+
public static function getGenerateRelativePathData()
133133
{
134134
return [
135135
['../foo.png', '/foo.png', '/foo/bar.html'],

Tests/Extension/RoutingExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testEscaping($template, $mustBeEscaped)
3434
$this->assertSame($mustBeEscaped, $nodes->getNode('body')->getNode(0)->getNode('expr') instanceof FilterExpression);
3535
}
3636

37-
public function getEscapingTemplates()
37+
public static function getEscapingTemplates()
3838
{
3939
return [
4040
['{{ path("foo") }}', false],

Tests/Extension/SerializerExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testSerializeFilter(string $template, string $expectedResult)
4141
self::assertSame($expectedResult, $twig->render('template', ['object' => new SerializerModelFixture()]));
4242
}
4343

44-
public function serializerDataProvider(): \Generator
44+
public static function serializerDataProvider(): \Generator
4545
{
4646
yield ['{{ object|serialize }}', '{&quot;name&quot;:&quot;howdy&quot;,&quot;title&quot;:&quot;fixture&quot;}'];
4747
yield ['{{ object|serialize(\'yaml\') }}', '{ name: howdy, title: fixture }'];

Tests/Extension/StopwatchExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testTiming($template, $events)
4141
}
4242
}
4343

44-
public function getTimingTemplates()
44+
public static function getTimingTemplates()
4545
{
4646
return [
4747
['{% stopwatch "foo" %}something{% endstopwatch %}', 'foo'],

0 commit comments

Comments
 (0)