8000 Merge branch '6.3' into 6.4 · symfony/symfony@a9a49a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a9a49a6

Browse files
Merge branch '6.3' into 6.4
* 6.3: [Console] Fix horizontal table top border is incorrectly rendered [Tests] Streamline [Uid] Fix UuidV7 collisions within the same ms [Validator] updated Romanian translation
2 parents 1781648 + 7a59ef0 commit a9a49a6

File tree

68 files changed

+337
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+337
-145
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function testMappingTypeDetection()
190190
$this->assertSame($mappingType, 'attribute');
191191
}
192192

193-
public static function providerBasicDrivers()
193+
public static function providerBasicDrivers(): array
194194
{
195195
return [
196196
['doctrine.orm.cache.apc.class', ['type' => 'apc']],
@@ -269,7 +269,7 @@ public function testUnrecognizedCacheDriverException()
269269
$this->invokeLoadCacheDriver($objectManager, $container, $cacheName);
270270
}
271271

272-
public static function providerBundles()
272+
public static function providerBundles(): iterable
273273
{
274274
yield ['AnnotationsBundle', 'attribute', '/Entity'];
275275
yield ['AnnotationsOneLineBundle', 'attribute', '/Entity'];

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function testChoiceTranslationDomainIsDisabledByDefault($expanded)
143143
}
144144
}
145145

146-
public static function choiceTranslationDomainProvider()
146+
public static function choiceTranslationDomainProvider(): array
147147
{
148148
return [
149149
[false],
@@ -223,8 +223,6 @@ public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder()
223223
'class' => self::SINGLE_IDENT_CLASS,
224224
'query_builder' => fn () => new \stdClass(),
225225
]);
226-
227-
$field->submit('2');
228226
}
229227

230228
public function testConfigureQueryBuilderWithClosureReturningNullUseDefault()

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public function testValidateResultTypes($entity1, $result)
471471
$this->assertNoViolation();
472472
}
473473

474-
public static function resultTypesProvider()
474+
public static function resultTypesProvider(): array
475475
{
476476
$entity = new SingleIntIdEntity(1, 'foo');
477477

src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testVerbosityMapping($verbosity, $level, $isHandling, array $map
8282
$this->assertFalse($handler->handle($infoRecord), 'The handler finished handling the log.');
8383
}
8484

85-
public static function provideVerbosityMappingTests()
85+
public static function provideVerbosityMappingTests(): array
8686
{
8787
return [
8888
[OutputInterface::VERBOSITY_QUIET, Logger::ERROR, true],

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/ConfigurationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ public function testToleratesForIndividualGroups(string $deprecationsHelper, arr
249249
}
250250
}
251251

252-
public static function provideDataForToleratesForGroup() {
253-
252+
public static function provideDataForToleratesForGroup(): iterable
253+
{
254254
yield 'total threshold not reached' => ['max[total]=1', [
255255
'unsilenced' => 0,
256256
'self' => 0,

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testItMutesOnlySpecificErrorMessagesWhenTheCallingCodeIsInPhpuni
9797
$this->assertSame($muted, $deprecation->isMuted());
9898
}
9999

100-
public static function mutedProvider()
100+
public static function mutedProvider(): iterable
101101
{
102102
yield 'not from phpunit, and not a whitelisted message' => [
103103
false,
@@ -147,7 +147,7 @@ public function testItTakesMutesDeprecationFromPhpUnitFiles()
147147
$this->assertTrue($deprecation->isMuted());
148148
}
149149

150-
public static function providerGetTypeDetectsSelf()
150+
public static function providerGetTypeDetectsSelf(): array
151151
{
152152
return [
153153
'not_from_vendors_file' => [Deprecation::TYPE_SELF, '', 'MyClass1', __FILE__],
@@ -182,7 +182,7 @@ public function testGetTypeDetectsSelf(string $expectedType, string $message, st
182182
$this->assertSame($expectedType, $deprecation->getType());
183183
}
184184

185-
public static function providerGetTypeUsesRightTrace()
185+
public static function providerGetTypeUsesRightTrace(): array
186186
{
187187
$vendorDir = self::getVendorDir();
188188
$fakeTrace = [

src/Symfony/Bridge/Twig/Tests/AppVariableTest.php

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

44-
public static function debugDataProvider()
44+
public static function debugDataProvider(): array
4545
{
4646
return [
4747
'debug on' => [true],

src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php

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

149-
public static function provideCompletionSuggestions()
149+
public static function provideCompletionSuggestions(): iterable
150150
{
151151
yield 'option' => [['--format', ''], ['txt', 'json', 'github']];
152152
}

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testThemeBlockInheritanceUsingDynamicExtend()
6868
);
6969
}
7070

71-
public static function isSelectedChoiceProvider()
71+
public static function isSelectedChoiceProvider(): array
7272
{
7373
return [
7474
[true, '0', '0'],
@@ -118,7 +118,7 @@ public function testStartTagHasActionAttributeWhenActionIsZero()
118118
$this->assertSame('<form name="form" method="get" action="0">', $html);
119119
}
120120

121-
public static function isRootFormProvider()
121+
public static function isRootFormProvider(): array
122122
{
123123
return [
124124
[true, new FormView()],
@@ -295,14 +295,68 @@ public function testLabelHtmlIsTrue()
295295
$this->assertMatchesXpath($html, '/label[@for="name"][@class="my&class required"]/b[.="Bolded label"]');
296296
}
297297

298-
public static function themeBlockInheritanceProvider()
298+
protected function renderForm(FormView $view, array $vars = [])
299+
{
300+
return $this->renderer->renderBlock($view, 'form', $vars);
301+
}
302+
303+
protected function renderLabel(FormView $view, $label = null, array $vars = [])
304+
{
305+
if (null !== $label) {
306+
$vars += ['label' => $label];
307+
}
308+
309+
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
310+
}
311+
312+
protected function renderHelp(FormView $view)
313+
{
314+
return $this->renderer->searchAndRenderBlock($view, 'help');
315+
}
316+
317+
protected function renderErrors(FormView $view)
318+
{
319+
return $this->renderer->searchAndRenderBlock($view, 'errors');
320+
}
321+
322+
protected function renderWidget(FormView $view, array $vars = [])
323+
{
324+
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
325+
}
326+
327+
protected function renderRow(FormView $view, array $vars = [])
328+
{
329+
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
330+
}
331+
332+
protected function renderRest(FormView $view, array $vars = [])
333+
{
334+
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
335+
}
336+
337+
protected function renderStart(FormView $view, array $vars = [])
338+
{
339+
return $this->renderer->renderBlock($view, 'form_start', $vars);
340+
}
341+
342+
protected function renderEnd(FormView $view, array $vars = [])
343+
{
344+
return $this->renderer->renderBlock($view, 'form_end', $vars);
345+
}
346+
347+
protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
348+
{
349+
$this->renderer->setTheme($view, $themes, $useDefaultThemes);
350+
}
351+
352+
public static function themeBlockInheritanceProvider(): array
299353
{
300354
return [
301355
[['theme.html.twig']],
302356
];
303357
}
304358

305-
public static function themeInheritanceProvider()
359+
public static function themeInheritanceProvider(): array
306360
{
307361
return [
308362
[['parent_label.html.twig'], ['child_label.html.twig']],

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testWarmUp(array $loaders)
4040
$this->assertTrue($arrayPool->getItem('Symfony_Bundle_FrameworkBundle_Tests_Fixtures_Serialization_Author')->isHit());
4141
}
4242

43-
public static function loaderProvider()
43+
public static function loaderProvider(): array
4444
{
4545
return [
4646
[

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testComplete(array $input, array $expectedSuggestions)
4444
$this->assertSame($expectedSuggestions, $suggestions);
4545
}
4646

47-
public static function provideCompletionSuggestions()
47+
public static function provideCompletionSuggestions(): iterable
4848
{
4949
yield 'pool_name' => [
5050
['f'],

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php

Lines changed: 1 addition & 1 deletion
10000
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testComplete(array $input, array $expectedSuggestions)
9898
$this->assertSame($expectedSuggestions, $suggestions);
9999
}
100100

101-
public static function provideCompletionSuggestions()
101+
public static function provideCompletionSuggestions(): iterable
102102
{
103103
yield 'pool_name' => [
104104
['f'],

src/Symfony/Bundle/FrameworkBundle/Tests/Command/EventDispatcherDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3232
$this->assertSame($expectedSuggestions, $suggestions);
3333
}
3434

35-
public static function provideCompletionSuggestions()
35+
public static function provideCompletionSuggestions(): iterable
3636
{
3737
yield 'event' => [[''], [MessageEvent::class, 'console.command']];
3838
yield 'event for other dispatcher' => [['--dispatcher', 'other_event_dispatcher', ''], ['other_event', 'App\OtherEvent']];

src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsRemoveCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testComplete(bool $withLocalVault, array $input, array $expected
3737
$this->assertSame($expectedSuggestions, $suggestions);
3838
}
3939

40-
public static function provideCompletionSuggestions()
40+
public static function provideCompletionSuggestions(): iterable
4141
{
4242
yield 'name' => [true, [''], ['SECRET', 'OTHER_SECRET']];
4343
yield '--local name (with local vault)' => [true, ['--local', ''], ['SECRET']];

src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsSetCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testComplete(array $input, array $expectedSuggestions)
3232
$this->assertSame($expectedSuggestions, $suggestions);
3333
}
3434

35-
public static function provideCompletionSuggestions()
35+
public static function provideCompletionSuggestions(): iterable
3636
{
3737
yield 'name' => [[''], ['SECRET', 'OTHER_SECRET']];
3838
yield '--local name (with local vault)' => [['--local', ''], ['SECRET', 'OTHER_SECRET']];

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function ($path, $catalogue) use ($extractedMessagesWithDomains) {
269269
$this->assertSame($expectedSuggestions, $suggestions);
270270
}
271271

272-
public static function provideCompletionSuggestions()
272+
public static function provideCompletionSuggestions(): iterable
273273
{
274274
yield 'locale' => [
275275
[''],

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandCompletionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testComplete(array $input, array $expectedSuggestions)
4242
$this->assertSame($expectedSuggestions, $suggestions);
4343
}
4444

45-
public static function provideCompletionSuggestions()
45+
public static function provideCompletionSuggestions(): iterable
4646
{
4747
$bundle = new ExtensionPresentBundle();
4848

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public function testdenyAccessUnlessGrantedSetsAttributesAsArray($attribute, $ex
386386
}
387387
}
388388

389-
public static function provideDenyAccessUnlessGrantedSetsAttributesAsArray()
389+
public static function provideDenyAccessUnlessGrantedSetsAttributesAsArray(): array
390390
{
391391
$obj = new \stdClass();
392392
$obj->foo = 'bar';

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testRoute($permanent, $keepRequestMethod, $keepQueryParams, $ign
103103
$this->assertEquals($expectedCode, $returnResponse->getStatusCode());
104104
}
105105

106-
public static function provider()
106+
public static function provider(): array
107107
{
108108
return [
109109
[true, false, false, false, 301, ['additional-parameter' => 'value']],
@@ -210,7 +210,7 @@ public function testUrlRedirectDefaultPorts()
210210
$this->assertRedirectUrl($returnValue, $expectedUrl);
211211
}
212212

213-
public static function urlRedirectProvider()
213+
public static function urlRedirectProvider(): array
214214
{
215215
return [
216216
// Standard ports
@@ -262,7 +262,7 @@ public function testUrlRedirect($scheme, $httpPort, $httpsPort, $requestScheme,
262262
$this->assertRedirectUrl($returnValue, $expectedUrl);
263263
}
264264

265-
public static function pathQueryParamsProvider()
265+
public static function pathQueryParamsProvider(): array
266266
{
267267
return [
268268
['http://www.example.com/base/redirect-path', '/redirect-path', ''],

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TemplateControllerTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,23 @@ public function testTwig()
3232
$this->assertEquals('bar', $controller('mytemplate')->getContent());
3333
}
3434

35-
public function testNoTwig()
35+
public function testNoTwigTemplateActionMethod()
3636
{
37+
$controller = new TemplateController();
38+
3739
$this->expectException(\LogicException::class);
3840
$this->expectExceptionMessage('You cannot use the TemplateController if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
39-
$controller = new TemplateController();
4041

4142
$controller->templateAction('mytemplate')->getContent();
43+
}
44+
45+
public function testNoTwigInvokeMethod()
46+
{
47+
$controller = new TemplateController();
48+
49+
$this->expectException(\LogicException::class);
50+
$this->expectExceptionMessage('You cannot use the TemplateController if the Twig Bundle is not available.');
51+
4252
$controller('mytemplate')->getContent();
4353
}
4454

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testValidAssetsPackageNameConfiguration($packageName)
163163
$this->assertArrayHasKey($packageName, $config['assets']['packages']);
164164
}
165165

166-
public static function provideValidAssetsPackageNameConfigurationTests()
166+
public static function provideValidAssetsPackageNameConfigurationTests(): array
167167
{
168168
return [
169169
['foobar'],
@@ -192,7 +192,7 @@ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMess
192192
]);
193193
}
194194

195-
public static function provideInvalidAssetConfigurationTests()
195+
public static function provideInvalidAssetConfigurationTests(): iterable
196196
{
197197
// helper to turn config into embedded package config
198198
$createPackageConfig = fn (array $packageConfig) => [
@@ -246,7 +246,7 @@ public function testValidLockConfiguration($lockConfig, $processedConfig)
246246
$this->assertEquals($processedConfig, $config['lock']);
247247
}
248248

249-
public static function provideValidLockConfigurationTests()
249+
public static function provideValidLockConfigurationTests(): iterable
250250
{
251251
yield [null, ['enabled' => true, 'resources' => ['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]]];
252252

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function testGetDeprecationNoFile()
269269
$this->assertStringContainsString('[WARNING] The deprecation file does not exist', $tester->getDisplay());
270270
}
271271

272-
public static function provideIgnoreBackslashWhenFindingService()
272+
public static function provideIgnoreBackslashWhenFindingService(): array
273273
{
274274
return [
275275
[BackslashClass::class],
@@ -297,7 +297,7 @@ public function testComplete(array $input, array $expectedSuggestions, array $no
297297
}
298298
}
299299

300-
public static function provideCompletionSuggestions()
300+
public static function provideCompletionSuggestions(): iterable
301301
{
302302
$serviceId = 'console.command.container_debug';
303303
$hiddenServiceId = '.console.command.container_debug.lazy';

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testShowAliases(string $format)
110110
$this->assertStringContainsString('my_custom_alias', $tester->getDisplay());
111111
}
112112

113-
public static function provideCompletionSuggestions()
113+
public static function provideCompletionSuggestions(): iterable
114114
{
115115
yield 'option --format' => [
116116
['--format', ''],

src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function dispatch(object $event, string $eventName = null): object
397397
$this->assertSame($dataCollector->getVoterStrategy(), $strategy, 'Wrong value returned by getVoterStrategy');
398398
}
399399

400-
public static function provideRoles()
400+
public static function provideRoles(): array
401401
{
402402
return [
403403
// Basic roles

0 commit comments

Comments
 (0)
0