Skip to content

Remove void return type from test methods #39460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class MyListener
public $calledByInvokeCount = 0;
public $calledByEventNameCount = 0;

public function __invoke(): void
public function __invoke()
{
++$this->calledByInvokeCount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ public function provideMailer(): array
/**
* @dataProvider provideMailer
*/
public function testMailer(string $configFile, array $expectedTransports): void
public function testMailer(string $configFile, array $expectedTransports)
{
$container = $this->createContainerFromFile($configFile);

Expand All @@ -1463,14 +1463,14 @@ public function testMailer(string $configFile, array $expectedTransports): void
$this->assertEquals(new Reference('messenger.default_bus', ContainerInterface::NULL_ON_INVALID_REFERENCE), $container->getDefinition('mailer.mailer')->getArgument(1));
}

public function testMailerWithDisabledMessageBus(): void
public function testMailerWithDisabledMessageBus()
{
$container = $this->createContainerFromFile('mailer_with_disabled_message_bus');

$this->assertNull($container->getDefinition('mailer.mailer')->getArgument(1));
}

public function testMailerWithSpecificMessageBus(): void
public function testMailerWithSpecificMessageBus()
{
$container = $this->createContainerFromFile('mailer_with_specific_message_bus');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

final class EventAliasTest extends AbstractWebTestCase
{
public function testAliasedEvents(): void
public function testAliasedEvents()
{
$client = $this->createClient(['test_case' => 'AliasedEvents', 'root_config' => 'config.yml']);
$container = $client->getContainer();
Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ public function provideFormat(): array
];
}

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

Expand All @@ -887,7 +887,7 @@ public function testIterate(): void
);
}

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

Expand Down Expand Up @@ -936,7 +936,7 @@ public function testBarWidthWithMultilineFormat()
putenv('COLUMNS=120');
}

public function testMinAndMaxSecondsBetweenRedraws(): void
public function testMinAndMaxSecondsBetweenRedraws()
{
$bar = new ProgressBar($output = $this->getOutputStream());
$bar->setRedrawFrequency(1);
Expand All @@ -959,7 +959,7 @@ public function testMinAndMaxSecondsBetweenRedraws(): void
);
}

public function testMaxSecondsBetweenRedraws(): void
public function testMaxSecondsBetweenRedraws()
{
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
$bar->setRedrawFrequency(4); // disable step based redraws
Expand Down Expand Up @@ -1014,7 +1014,7 @@ public function testMinSecondsBetweenRedraws()
);
}

public function testNoWriteWhenMessageIsSame(): void
public function testNoWriteWhenMessageIsSame()
{
$bar = new ProgressBar($output = $this->getOutputStream(), 2);
$bar->start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ public function provideTransformations(): array
/**
* @dataProvider provideTransformations
*/
public function testTransform($from, $to): void
public function testTransform($from, $to)
{
$transformer = new StringToFloatTransformer();

$this->assertSame($to, $transformer->transform($from));
}

public function testFailIfTransformingANonString(): void
public function testFailIfTransformingANonString()
{
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
$transformer = new StringToFloatTransformer();
$transformer->transform(1.0);
}

public function testFailIfTransformingANonNumericString(): void
public function testFailIfTransformingANonNumericString()
{
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
$transformer = new StringToFloatTransformer();
Expand All @@ -70,14 +70,14 @@ public function provideReverseTransformations(): array
/**
* @dataProvider provideReverseTransformations
*/
public function testReverseTransform($from, $to, int $scale = null): void
public function testReverseTransform($from, $to, int $scale = null)
{
$transformer = new StringToFloatTransformer($scale);

$this->assertSame($to, $transformer->reverseTransform($from));
}

public function testFailIfReverseTransformingANonNumeric(): void
public function testFailIfReverseTransformingANonNumeric()
{
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
$transformer = new StringToFloatTransformer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,39 @@ protected function tearDown(): void
\Locale::setDefault($this->defaultLocale);
}

public function testDefaultFormatting(): void
public function testDefaultFormatting()
{
$form = $this->factory->create(static::TESTED_TYPE);
$form->setData('12345.67890');

$this->assertSame('12345,679', $form->createView()->vars['value']);
}

public function testDefaultFormattingWithGrouping(): void
public function testDefaultFormattingWithGrouping()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['grouping' => true]);
$form->setData('12345.67890');

$this->assertSame('12.345,679', $form->createView()->vars['value']);
}

public function testDefaultFormattingWithScale(): void
public function testDefaultFormattingWithScale()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
$form->setData('12345.67890');

$this->assertSame('12345,68', $form->createView()->vars['value']);
}

public function testDefaultFormattingWithScaleFloat(): void
public function testDefaultFormattingWithScaleFloat()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
$form->setData(12345.67890);

$this->assertSame('12345,68', $form->createView()->vars['value']);
}

public function testDefaultFormattingWithScaleAndStringInput(): void
public function testDefaultFormattingWithScaleAndStringInput()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2, 'input' => 'string']);
$form->setData('12345.67890');
Expand Down