Skip to content

Commit 55b0015

Browse files
OskarStarknicolas-grekas
authored andcommitted
Migrate to static data providers using rector/rector
1 parent 17b3787 commit 55b0015

13 files changed

+25
-25
lines changed

Tests/Annotation/RouteTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function getMethodAnnotation(string $method, bool $attributes): Route
4242
return $route;
4343
}
4444

45-
public function provideDeprecationArrayAsFirstArgument()
45+
public static function provideDeprecationArrayAsFirstArgument()
4646
{
4747
return [
4848
['requirements', ['locale' => 'en'], 'getRequirements'],
@@ -89,7 +89,7 @@ public function testLoadFromDoctrineAnnotation(string $methodName, string $gette
8989
$this->assertEquals($route->$getter(), $expectedReturn);
9090
}
9191

92-
public function getValidParameters(): iterable
92+
public static function getValidParameters(): iterable
9393
{
9494
return [
9595
['simplePath', 'getPath', '/Blog'],

Tests/Generator/UrlGeneratorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function testAbsoluteUrlWithExtraParameters(string $expectedQueryString,
130130
$this->assertSame('http://localhost/app.php/testing'.$expectedQueryString, $url);
131131
}
132132

133-
public function valuesProvider(): array
133+
public static function valuesProvider(): array
134134
{
135135
$stdClass = new \stdClass();
136136
$stdClass->baz = 'bar';
@@ -862,7 +862,7 @@ public function testGetRelativePath($sourcePath, $targetPath, $expectedPath)
862862
$this->assertSame($expectedPath, UrlGenerator::getRelativePath($sourcePath, $targetPath));
863863
}
864864

865-
public function provideRelativePaths()
865+
public static function provideRelativePaths()
866866
{
867867
return [
868868
[
@@ -1004,7 +1004,7 @@ public function testLookRoundRequirementsInPath($expected, $path, $requirement)
10041004
$this->assertSame($expected, $this->getGenerator($routes)->generate('test', ['foo' => 'a/b', 'baz' => 'c/d/e']));
10051005
}
10061006

1007-
public function provideLookAroundRequirementsInPath()
1007+
public static function provideLookAroundRequirementsInPath()
10081008
{
10091009
yield ['/app.php/a/b/b%28ar/c/d/e', '/{foo}/b(ar/{baz}', '.+(?=/b\\(ar/)'];
10101010
yield ['/app.php/a/b/bar/c/d/e', '/{foo}/bar/{baz}', '.+(?!$)'];

Tests/Loader/AnnotationClassLoaderTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testSupportsChecksResource($resource, $expectedSupports)
3030
$this->assertSame($expectedSupports, $this->loader->supports($resource), '->supports() returns true if the resource is loadable');
3131
}
3232

33-
public function provideTestSupportsChecksResource()
33+
public static function provideTestSupportsChecksResource()
3434
{
3535
return [
3636
['class', true],

Tests/Loader/ContainerLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testSupports(bool $expected, string $type = null)
2525
$this->assertSame($expected, (new ContainerLoader(new Container()))->supports('foo', $type));
2626
}
2727

28-
public function supportsProvider()
28+
public static function supportsProvider()
2929
{
3030
return [
3131
[true, 'service'],

Tests/Loader/ObjectLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testExceptionWithoutSyntax(string $resourceString)
5050
$loader->load($resourceString);
5151
}
5252

53-
public function getBadResourceStrings()
53+
public static function getBadResourceStrings()
5454
{
5555
return [
5656
['Foo:Bar:baz'],

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testLoadThrowsExceptionWithInvalidFileEvenWithoutSchemaValidatio
230230
$loader->load($filePath);
231231
}
232232

233-
public function getPathsToInvalidFiles()
233+
public static function getPathsToInvalidFiles()
234234
{
235235
return [
236236
['nonvalidnode.xml'],
@@ -478,7 +478,7 @@ public function testImportRouteWithController($file)
478478
$this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller'));
479479
}
480480

481-
public function provideFilesImportingRoutesWithControllers()
481+
public static function provideFilesImportingRoutesWithControllers()
482482
{
483483
yield ['import_controller.xml'];
484484
yield ['import__controller.xml'];

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testLoadThrowsExceptionWithInvalidFile($filePath)
5252
$loader->load($filePath);
5353
}
5454

55-
public function getPathsToInvalidFiles()
55+
public static function getPathsToInvalidFiles()
5656
{
5757
return [
5858
['nonvalid.yml'],
@@ -171,7 +171,7 @@ public function testImportRouteWithController($file)
171171
$this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller'));
172172
}
173173

174-
public function provideFilesImportingRoutesWithControllers()
174+
public static function provideFilesImportingRoutesWithControllers()
175175
{
176176
yield ['import_controller.yml'];
177177
yield ['import__controller.yml'];

Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testDump(RouteCollection $collection, $fixture)
6565
$this->assertStringEqualsFile($basePath.$fixture, $dumper->dump());
6666
}
6767

68-
public function getRouteCollections()
68+
public static function getRouteCollections()
6969
{
7070
/* test case 1 */
7171

Tests/Matcher/Dumper/StaticPrefixCollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testGrouping(array $routes, $expected)
3434
$this->assertEquals($expected, $dumped);
3535
}
3636

37-
public function routeProvider()
37+
public static function routeProvider()
3838
{
3939
return [
4040
'Simple - not nested' => [

Tests/Matcher/ExpressionLanguageProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testCompile(string $expression, string $expected)
5959
$this->assertSame($expected, $this->expressionLanguage->compile($expression));
6060
}
6161

62-
public function compileProvider(): iterable
62+
public static function compileProvider(): iterable
6363
{
6464
return [
6565
['env("APP_ENV")', '($context->getParameter(\'_functions\')->get(\'env\')("APP_ENV"))'],
@@ -76,7 +76,7 @@ public function testEvaluate(string $expression, $expected)
7676
$this->assertSame($expected, $this->expressionLanguage->evaluate($expression, ['context' => $this->context]));
7777
}
7878

79-
public function evaluateProvider(): iterable
79+
public static function evaluateProvider(): iterable
8080
{
8181
return [
8282
['env("APP_ENV")', 'test'],

0 commit comments

Comments
 (0)