Merge branch '4.4' into 5.1

* 4.4:
  Remove :void in test function signatures
This commit is contained in:
Fabien Potencier 2020-12-18 09:02:46 +01:00
commit 090b4256f0
22 changed files with 41 additions and 41 deletions

View File

@ -21,7 +21,7 @@ use Symfony\Component\BrowserKit\Test\Constraint\BrowserCookieValueSame;
class BrowserCookieValueSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$browser = $this->getBrowser();
$constraint = new BrowserCookieValueSame('foo', 'bar', false, '/path');

View File

@ -21,7 +21,7 @@ use Symfony\Component\BrowserKit\Test\Constraint\BrowserHasCookie;
class BrowserHasCookieTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$browser = $this->getBrowser();
$constraint = new BrowserHasCookie('foo', '/path');
@ -42,7 +42,7 @@ class BrowserHasCookieTest extends TestCase
$this->fail();
}
public function testConstraintWithWrongPath(): void
public function testConstraintWithWrongPath()
{
$browser = $this->getBrowser();
$constraint = new BrowserHasCookie('foo', '/other');
@ -57,7 +57,7 @@ class BrowserHasCookieTest extends TestCase
$this->fail();
}
public function testConstraintWithWrongDomain(): void
public function testConstraintWithWrongDomain()
{
$browser = $this->getBrowser();
$constraint = new BrowserHasCookie('foo', '/path', 'example.org');

View File

@ -1263,7 +1263,7 @@ EOTXT;
return str_replace(\PHP_EOL, "\n", stream_get_contents($output->getStream()));
}
public function testWithColspanAndMaxWith(): void
public function testWithColspanAndMaxWith()
{
$table = new Table($output = $this->getOutputStream());

View File

@ -202,7 +202,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
}
public function testEmptyEnvWhichCannotBeEmptyForScalarNode(): void
public function testEmptyEnvWhichCannotBeEmptyForScalarNode()
{
$container = new ContainerBuilder();
$container->registerExtension($ext = new EnvExtension());
@ -215,7 +215,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
}
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation(): void
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation()
{
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
$this->expectExceptionMessage('The path "env_extension.scalar_node_not_empty_validated" cannot contain an environment variable when empty values are not allowed by definition and are validated.');
@ -229,7 +229,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
$this->doProcess($container);
}
public function testPartialEnvWhichCannotBeEmptyForScalarNode(): void
public function testPartialEnvWhichCannotBeEmptyForScalarNode()
{
$container = new ContainerBuilder();
$container->registerExtension($ext = new EnvExtension());
@ -242,7 +242,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
}
public function testEnvWithVariableNode(): void
public function testEnvWithVariableNode()
{
$container = new ContainerBuilder();
$container->registerExtension($ext = new EnvExtension());
@ -266,7 +266,7 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
$this->addToAssertionCount(1);
}
public function testDiscardedEnvInConfig(): void
public function testDiscardedEnvInConfig()
{
$container = new ContainerBuilder();
$container->setParameter('env(BOOLISH)', '1');

View File

@ -19,7 +19,7 @@ use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorAttributeValueSa
class CrawlerSelectorAttributeValueSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new CrawlerSelectorAttributeValueSame('input[name="username"]', 'value', 'Fabien');
$this->assertTrue($constraint->evaluate(new Crawler('<html><body><form><input type="text" name="username" value="Fabien">'), '', true));

View File

@ -19,7 +19,7 @@ use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorExists;
class CrawlerSelectorExistsTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new CrawlerSelectorExists('title');
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>'), '', true));

View File

@ -19,7 +19,7 @@ use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorTextContains;
class CrawlerSelectorTextContainsTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new CrawlerSelectorTextContains('title', 'Foo');
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>Foobar'), '', true));

View File

@ -19,7 +19,7 @@ use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorTextSame;
class CrawlerSelectorTextSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new CrawlerSelectorTextSame('title', 'Foo');
$this->assertTrue($constraint->evaluate(new Crawler('<html><head><title>Foo'), '', true));

View File

@ -61,7 +61,7 @@ class RegisterListenersPassTest extends TestCase
$this->assertEquals($expectedCalls, $eventDispatcherDefinition->getMethodCalls());
}
public function testAliasedEventSubscriber(): void
public function testAliasedEventSubscriber()
{
$builder = new ContainerBuilder();
$builder->setParameter('event_dispatcher.event_aliases', [AliasedEvent::class => 'aliased_event']);
@ -231,7 +231,7 @@ class RegisterListenersPassTest extends TestCase
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
}
public function testAliasedEventListener(): void
public function testAliasedEventListener()
{
$container = new ContainerBuilder();
$eventAliases = [AliasedEvent::class => 'aliased_event'];
@ -272,7 +272,7 @@ class RegisterListenersPassTest extends TestCase
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
}
public function testOmitEventNameOnTypedListener(): void
public function testOmitEventNameOnTypedListener()
{
$container = new ContainerBuilder();
$container->setParameter('event_dispatcher.event_aliases', [AliasedEvent::class => 'aliased_event']);
@ -305,7 +305,7 @@ class RegisterListenersPassTest extends TestCase
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
}
public function testOmitEventNameOnUntypedListener(): void
public function testOmitEventNameOnUntypedListener()
{
$container = new ContainerBuilder();
$container->register('foo', InvokableListenerService::class)->addTag('kernel.event_listener', ['method' => 'onEvent']);
@ -318,7 +318,7 @@ class RegisterListenersPassTest extends TestCase
$registerListenersPass->process($container);
}
public function testOmitEventNameAndMethodOnUntypedListener(): void
public function testOmitEventNameAndMethodOnUntypedListener()
{
$container = new ContainerBuilder();
$container->register('foo', InvokableListenerService::class)->addTag('kernel.event_listener');
@ -334,7 +334,7 @@ class RegisterListenersPassTest extends TestCase
/**
* @requires PHP 7.2
*/
public function testOmitEventNameAndMethodOnGenericListener(): void
public function testOmitEventNameAndMethodOnGenericListener()
{
$container = new ContainerBuilder();
$container->register('foo', GenericListener::class)->addTag('kernel.event_listener');
@ -347,7 +347,7 @@ class RegisterListenersPassTest extends TestCase
$registerListenersPass->process($container);
}
public function testOmitEventNameOnSubscriber(): void
public function testOmitEventNameOnSubscriber()
{
$container = new ContainerBuilder();
$container->register('subscriber', IncompleteSubscriber::class)

View File

@ -717,7 +717,7 @@ class DateTimeTypeTest extends BaseTypeTest
];
}
public function testSubmitStringWithCustomInputFormat(): void
public function testSubmitStringWithCustomInputFormat()
{
$form = $this->factory->create(static::TESTED_TYPE, null, [
'model_timezone' => 'UTC',

View File

@ -1048,7 +1048,7 @@ class DateTypeTest extends BaseTypeTest
];
}
public function testSubmitStringWithCustomInputFormat(): void
public function testSubmitStringWithCustomInputFormat()
{
$form = $this->factory->create(static::TESTED_TYPE, null, [
'model_timezone' => 'UTC',

View File

@ -99,7 +99,7 @@ class NumberTypeTest extends BaseTypeTest
]);
}
public function testDefaultFormattingWithRounding(): void
public function testDefaultFormattingWithRounding()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 0, 'rounding_mode' => \NumberFormatter::ROUND_UP]);
$form->setData('12345.54321');
@ -139,7 +139,7 @@ class NumberTypeTest extends BaseTypeTest
$this->assertNull($form->getData());
}
public function testSubmitNumericInput(): void
public function testSubmitNumericInput()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'number']);
$form->submit('1,234');
@ -149,7 +149,7 @@ class NumberTypeTest extends BaseTypeTest
$this->assertSame('1,234', $form->getViewData());
}
public function testSubmitNumericInputWithScale(): void
public function testSubmitNumericInputWithScale()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'number', 'scale' => 2]);
$form->submit('1,234');
@ -159,7 +159,7 @@ class NumberTypeTest extends BaseTypeTest
$this->assertSame('1,23', $form->getViewData());
}
public function testSubmitStringInput(): void
public function testSubmitStringInput()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'string']);
$form->submit('1,234');
@ -169,7 +169,7 @@ class NumberTypeTest extends BaseTypeTest
$this->assertSame('1,234', $form->getViewData());
}
public function testSubmitStringInputWithScale(): void
public function testSubmitStringInputWithScale()
{
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'string', 'scale' => 2]);
$form->submit('1,234');

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\RequestAttributeValueSame;
class RequestAttributeValueSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$request = new Request();
$request->attributes->set('foo', 'bar');

View File

@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseCookieValueSame;
class ResponseCookieValueSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$response = new Response();
$response->headers->setCookie(Cookie::create('foo', 'bar', 0, '/path'));

View File

@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseHasCookie;
class ResponseHasCookieTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$response = new Response();
$response->headers->setCookie(Cookie::create('foo', 'bar'));

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseHasHeader;
class ResponseHasHeaderTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new ResponseHasHeader('Date');
$this->assertTrue($constraint->evaluate(new Response(), '', true));

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseHeaderSame;
class ResponseHeaderSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new ResponseHeaderSame('Cache-Control', 'no-cache, private');
$this->assertTrue($constraint->evaluate(new Response(), '', true));

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseIsRedirected;
class ResponseIsRedirectedTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new ResponseIsRedirected();

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseIsSuccessful;
class ResponseIsSuccessfulTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new ResponseIsSuccessful();

View File

@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Test\Constraint\ResponseStatusCodeSame;
class ResponseStatusCodeSameTest extends TestCase
{
public function testConstraint(): void
public function testConstraint()
{
$constraint = new ResponseStatusCodeSame(200);
$this->assertTrue($constraint->evaluate(new Response(), '', true));

View File

@ -31,7 +31,7 @@ class SmtpTransportTest extends TestCase
$this->assertEquals('smtp://127.0.0.1:2525', (string) $t);
}
public function testSendDoesNotPingBelowThreshold(): void
public function testSendDoesNotPingBelowThreshold()
{
$stream = new DummyStream();
$envelope = new Envelope(new Address('sender@example.org'), [new Address('recipient@example.org')]);
@ -44,7 +44,7 @@ class SmtpTransportTest extends TestCase
$this->assertNotContains("NOOP\r\n", $stream->getCommands());
}
public function testSendPingAfterTransportException(): void
public function testSendPingAfterTransportException()
{
$stream = new DummyStream();
$envelope = new Envelope(new Address('sender@example.org'), [new Address('recipient@example.org')]);
@ -67,7 +67,7 @@ class SmtpTransportTest extends TestCase
$this->assertFalse($stream->isClosed());
}
public function testSendDoesPingAboveThreshold(): void
public function testSendDoesPingAboveThreshold()
{
$stream = new DummyStream();
$envelope = new Envelope(new Address('sender@example.org'), [new Address('recipient@example.org')]);

View File

@ -17,7 +17,7 @@ use Symfony\Component\Serializer\Extractor\ObjectPropertyListExtractor;
class ObjectPropertyListExtractorTest extends TestCase
{
public function testGetPropertiesWithoutObjectClassResolver(): void
public function testGetPropertiesWithoutObjectClassResolver()
{
$object = new \stdClass();
$context = ['bar' => true];
@ -35,7 +35,7 @@ class ObjectPropertyListExtractorTest extends TestCase
);
}
public function testGetPropertiesWithObjectClassResolver(): void
public function testGetPropertiesWithObjectClassResolver()
{
$object = new \stdClass();
$classResolver = function ($objectArg) use ($object): string {