Skip to content

Commit 54acc19

Browse files
committed
minor symfony#39544 Remove :void in test function signatures (fabpot)
This PR was merged into the 4.4 branch. Discussion ---------- Remove :void in test function signatures | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a<!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | n/a I've added a new rule in fabbot to detect usage of `: void` in test method signatures to please @nicolas-grekas :) Commits ------- 47fcf4a Remove :void in test function signatures
2 parents a71912d + 47fcf4a commit 54acc19

27 files changed

+62
-62
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/Functional/EventAliasTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
final class EventAliasTest extends AbstractWebTestCase
2626
{
27-
public function testAliasedEvents(): void
27+
public function testAliasedEvents()
2828
{
2929
$client = $this->createClient(['test_case' => 'AliasedEvents', 'root_config' => 'config.yml']);
3030
$container = $client->getContainer();

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExceptionListenerPassTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testExitsWhenTwigIsNotAvailable()
3131
$this->assertTrue($builder->hasDefinition('twig.exception_listener'));
3232
}
3333

34-
public function testRemovesTwigExceptionListenerWhenNoExceptionListenerControllerExists(): void
34+
public function testRemovesTwigExceptionListenerWhenNoExceptionListenerControllerExists()
3535
{
3636
$builder = new ContainerBuilder();
3737
$builder->register('twig', Environment::class);
@@ -45,7 +45,7 @@ public function testRemovesTwigExceptionListenerWhenNoExceptionListenerControlle
4545
$this->assertFalse($builder->hasDefinition('twig.exception_listener'));
4646
}
4747

48-
public function testRemovesTwigExceptionListenerIfTwigIsNotUsedAsTemplateEngine(): void
48+
public function testRemovesTwigExceptionListenerIfTwigIsNotUsedAsTemplateEngine()
4949
{
5050
$builder = new ContainerBuilder();
5151
$builder->register('twig', Environment::class);
@@ -60,7 +60,7 @@ public function testRemovesTwigExceptionListenerIfTwigIsNotUsedAsTemplateEngine(
6060
$this->assertFalse($builder->hasDefinition('twig.exception_listener'));
6161
}
6262

63-
public function testRemovesKernelExceptionListenerIfTwigIsUsedAsTemplateEngine(): void
63+
public function testRemovesKernelExceptionListenerIfTwigIsUsedAsTemplateEngine()
6464
{
6565
$builder = new ContainerBuilder();
6666
$builder->register('twig', Environment::class);

src/Symfony/Component/BrowserKit/Tests/Test/Constraint/BrowserCookieValueSameTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class BrowserCookieValueSameTest extends TestCase
2323
{
24-
public function testConstraint(): void
24+
public function testConstraint()
2525
{
2626
$browser = $this->getBrowser();
2727
$constraint = new BrowserCookieValueSame('foo', 'bar', false, '/path');

src/Symfony/Component/BrowserKit/Tests/Test/Constraint/BrowserHasCookieTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class BrowserHasCookieTest extends TestCase
2323
{
24-
public function testConstraint(): void
24+
public function testConstraint()
2525
{
2626
$browser = $this->getBrowser();
2727
$constraint = new BrowserHasCookie('foo', '/path');
@@ -42,7 +42,7 @@ public function testConstraint(): void
4242
$this->fail();
4343
}
4444

45-
public function testConstraintWithWrongPath(): void
45+
public function testConstraintWithWrongPath()
4646
{
4747
$browser = $this->getBrowser();
4848
$constraint = new BrowserHasCookie('foo', '/other');
@@ -57,7 +57,7 @@ public function testConstraintWithWrongPath(): void
5757
$this->fail();
5858
}
5959

60-
public function testConstraintWithWrongDomain(): void
60+
public function testConstraintWithWrongDomain()
6161
{
6262
$browser = $this->getBrowser();
6363
$constraint = new BrowserHasCookie('foo', '/path', 'example.org');

src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ public function provideFormat(): array
872872
];
873873
}
874874

875-
public function testIterate(): void
875+
public function testIterate()
876876
{
877877
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
878878

@@ -887,7 +887,7 @@ public function testIterate(): void
887887
);
888888
}
889889

890-
public function testIterateUncountable(): void
890+
public function testIterateUncountable()
891891
{
892892
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
893893

@@ -936,7 +936,7 @@ public function testBarWidthWithMultilineFormat()
936936
putenv('COLUMNS=120');
937937
}
938938

939-
public function testMinAndMaxSecondsBetweenRedraws(): void
939+
public function testMinAndMaxSecondsBetweenRedraws()
940940
{
941941
$bar = new ProgressBar($output = $this->getOutputStream());
942942
$bar->setRedrawFrequency(1);
@@ -959,7 +959,7 @@ public function testMinAndMaxSecondsBetweenRedraws(): void
959959
);
960960
}
961961

962-
public function testMaxSecondsBetweenRedraws(): void
962+
public function testMaxSecondsBetweenRedraws()
963963
{
964964
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
965965
$bar->setRedrawFrequency(4); // disable step based redraws
@@ -1014,7 +1014,7 @@ public function testMinSecondsBetweenRedraws()
10141014
);
10151015
}
10161016

1017-
public function testNoWriteWhenMessageIsSame(): void
1017+
public function testNoWriteWhenMessageIsSame()
10181018
{
10191019
$bar = new ProgressBar($output = $this->getOutputStream(), 2);
10201020
$bar->start();

src/Symfony/Component/Console/Tests/Helper/TableTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ protected function getOutputContent(StreamOutput $output)
12631263
return str_replace(\PHP_EOL, "\n", stream_get_contents($output->getStream()));
12641264
}
12651265

1266-
public function testWithColspanAndMaxWith(): void
1266+
public function testWithColspanAndMaxWith()
12671267
{
12681268
$table = new Table($output = $this->getOutputStream());
12691269

src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function testEnvIsNotUnset()
206206
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
207207
}
208208

209-
public function testEmptyEnvWhichCannotBeEmptyForScalarNode(): void
209+
public function testEmptyEnvWhichCannotBeEmptyForScalarNode()
210210
{
211211
$container = new ContainerBuilder();
212212
$container->registerExtension($ext = new EnvExtension());
@@ -225,7 +225,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode(): void
225225
* @group legacy
226226
* @expectedDeprecation Setting path "env_extension.scalar_node_not_empty_validated" to an environment variable is deprecated since Symfony 4.3. Remove "cannotBeEmpty()", "validate()" or include a prefix/suffix value instead.
227227
*/
228-
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation(): void
228+
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation()
229229
{
230230
$container = new ContainerBuilder();
231231
$container->registerExtension($ext = new EnvExtension());
@@ -238,7 +238,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation(): voi
238238
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
239239
}
240240

241-
public function testPartialEnvWhichCannotBeEmptyForScalarNode(): void
241+
public function testPartialEnvWhichCannotBeEmptyForScalarNode()
242242
{
243243
$container = new ContainerBuilder();
244244
$container->registerExtension($ext = new EnvExtension());
@@ -251,7 +251,7 @@ public function testPartialEnvWhichCannotBeEmptyForScalarNode(): void
251251
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
252252
}
253253

254-
public function testEnvWithVariableNode(): void
254+
public function testEnvWithVariableNode()
255255
{
256256
$container = new ContainerBuilder();
257257
$container->registerExtension($ext = new EnvExtension());
@@ -268,7 +268,7 @@ public function testEnvWithVariableNode(): void
268268
* @group legacy
269269
* @expectedDeprecation A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
270270
*/
271-
public function testConfigurationWithoutRootNode(): void
271+
public function testConfigurationWithoutRootNode()
272272
{
273273
$container = new ContainerBuilder();
274274
$container->registerExtension(new EnvExtension(new EnvConfigurationWithoutRootNode()));
@@ -288,7 +288,7 @@ public function testEmptyConfigFromMoreThanOneSource()
288288
$this->addToAssertionCount(1);
289289
}
290290

291-
public function testDiscardedEnvInConfig(): void
291+
public function testDiscardedEnvInConfig()
292292
{
293293
$container = new ContainerBuilder();
294294
$container->setParameter('env(BOOLISH)', '1');

src/Symfony/Component/DomCrawler/Tests/Test/Constraint/CrawlerSelectorAttributeValueSameTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CrawlerSelectorAttributeValueSameTest extends TestCase
2121
{
22-
public function testConstraint(): void
22+
public function testConstraint()
2323
{
2424
$constraint = new CrawlerSelectorAttributeValueSame('input[name="username"]', 'value', 'Fabien');
2525
$this->assertTrue($constraint->evaluate(new Crawler('<html><body><form><input type="text" name="username" value="Fabien">'), '', true));

src/Symfony/Component/DomCrawler/Tests/Test/Constraint/CrawlerSelectorExistsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CrawlerSelectorExistsTest extends TestCase
2121
{
22-
public function testConstraint(): void
22+
public function testConstraint()
2323
{
2424
$constraint = new CrawlerSelectorExists('title');
2525
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>'), '', true));

src/Symfony/Component/DomCrawler/Tests/Test/Constraint/CrawlerSelectorTextContainsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CrawlerSelectorTextContainsTest extends TestCase
2121
{
22-
public function testConstraint(): void
22+
public function testConstraint()
2323
{
2424
$constraint = new CrawlerSelectorTextContains('title', 'Foo');
2525
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>Foobar'), '', true));

src/Symfony/Component/DomCrawler/Tests/Test/Constraint/CrawlerSelectorTextSameTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CrawlerSelectorTextSameTest extends TestCase
2121
{
22-
public function testConstraint(): void
22+
public function testConstraint()
2323
{
2424
$constraint = new CrawlerSelectorTextSame('title', 'Foo');
2525
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>Foo'), '', true));

src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testValidEventSubscriber()
6161
$this->assertEquals($expectedCalls, $eventDispatcherDefinition->getMethodCalls());
6262
}
6363

64-
public function testAliasedEventSubscriber(): void
64+
public function testAliasedEventSubscriber()
6565
{
6666
$builder = new ContainerBuilder();
6767
$builder->setParameter('event_dispatcher.event_aliases', [AliasedEvent::class => 'aliased_event']);
@@ -210,7 +210,7 @@ public function testInvokableEventListener()
210210
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
211211
}
212212

213-
public function testAliasedEventListener(): void
213+
public function testAliasedEventListener()
214214
{
215215
$container = new ContainerBuilder();
216216
$eventAliases = [AliasedEvent::class => 'aliased_event'];
@@ -251,7 +251,7 @@ public function testAliasedEventListener(): void
251251
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
252252
}
253253

254-
public function testOmitEventNameOnTypedListener(): void
254+
public function testOmitEventNameOnTypedListener()
255255
{
256256
$container = new ContainerBuilder();
257257
$container->setParameter('event_dispatcher.event_aliases', [AliasedEvent::class => 'aliased_event']);
@@ -284,7 +284,7 @@ public function testOmitEventNameOnTypedListener(): void
284284
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
285285
}
286286

287-
public function testOmitEventNameOnUntypedListener(): void
287+
public function testOmitEventNameOnUntypedListener()
288288
{
289289
$container = new ContainerBuilder();
290290
$container->register('foo', InvokableListenerService::class)->addTag('kernel.event_listener', ['method' => 'onEvent']);
@@ -297,7 +297,7 @@ public function testOmitEventNameOnUntypedListener(): void
297297
$registerListenersPass->process($container);
298298
}
299299

300-
public function testOmitEventNameAndMethodOnUntypedListener(): void
300+
public function testOmitEventNameAndMethodOnUntypedListener()
301301
{
302302
$container = new ContainerBuilder();
303303
$container->register('foo', InvokableListenerService::class)->addTag('kernel.event_listener');
@@ -313,7 +313,7 @@ public function testOmitEventNameAndMethodOnUntypedListener(): void
313313
/**
314314
* @requires PHP 7.2
315315
*/
316-
public function testOmitEventNameAndMethodOnGenericListener(): void
316+
public function testOmitEventNameAndMethodOnGenericListener()
317317
{
318318
$container = new ContainerBuilder();
319319
$container->register('foo', GenericListener::class)->addTag('kernel.event_listener');
@@ -326,7 +326,7 @@ public function testOmitEventNameAndMethodOnGenericListener(): void
326326
$registerListenersPass->process($container);
327327
}
328328

329-
public function testOmitEventNameOnSubscriber(): void
329+
public function testOmitEventNameOnSubscriber()
330330
{
331331
$container = new ContainerBuilder();
332332
$container->register('subscriber', IncompleteSubscriber::class)

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public function testTransform($from, $to): void
3737
$this->assertSame($to, $transformer->transform($from));
3838
}
3939

40-
public function testFailIfTransformingANonString(): void
40+
public function testFailIfTransformingANonString()
4141
{
4242
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
4343
$transformer = new StringToFloatTransformer();
4444
$transformer->transform(1.0);
4545
}
4646

47-
public function testFailIfTransformingANonNumericString(): void
47+
public function testFailIfTransformingANonNumericString()
4848
{
4949
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
5050
$transformer = new StringToFloatTransformer();
@@ -77,7 +77,7 @@ public function testReverseTransform($from, $to, int $scale = null): void
7777
$this->assertSame($to, $transformer->reverseTransform($from));
7878
}
7979

80-
public function testFailIfReverseTransformingANonNumeric(): void
80+
public function testFailIfReverseTransformingANonNumeric()
8181
{
8282
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
8383
$transformer = new StringToFloatTransformer();

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ public function provideEmptyData()
729729
];
730730
}
731731

732-
public function testSubmitStringWithCustomInputFormat(): void
732+
public function testSubmitStringWithCustomInputFormat()
733733
{
734734
$form = $this->factory->create(static::TESTED_TYPE, null, [
735735
'model_timezone' => 'UTC',

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ public function provideEmptyData()
10481048
];
10491049
}
10501050

1051-
public function testSubmitStringWithCustomInputFormat(): void
1051+
public function testSubmitStringWithCustomInputFormat()
10521052
{
10531053
$form = $this->factory->create(static::TESTED_TYPE, null, [
10541054
'model_timezone' => 'UTC',

0 commit comments

Comments
 (0)