8000 Merge branch '5.4' into 6.0 · symfony/symfony@c236a3d · GitHub
[go: up one dir, main page]

Skip to content

Commit c236a3d

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Fix TranslationTrait for multiple domains Fix parameter types for ProcessHelper::mustRun() Fix: Wording [SecurityBundle] Fix ambiguous deprecation message on missing provider Remove dead code in tests Remove return void PHPDoc in test Fix merge
2 parents 1d64ab2 + dcf09d6 commit c236a3d

File tree

7 files changed

+84
-14
lines changed

7 files changed

+84
-14
lines changed

src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public function testResetServiceWillNotNestFurtherLazyServicesWithinEachOther()
9595
self::assertNotInstanceOf(ValueHolderInterface::class, $wrappedValue);
9696
}
9797

98-
/** @return void */
9998
private function dumpLazyServiceProjectAsFilesServiceContainer()
10099
{
101100
if (class_exists(\LazyServiceProjectAsFilesServiceContainer::class, false)) {

src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6969
return 1;
7070
}
7171

72-
$io->success('The container was lint successfully: all services are injected with values that are compatible with their type declarations.');
72+
$io->success('The container was linted successfully: all services are injected with values that are compatible with their type declarations.');
7373

7474
return 0;
7575
}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ public function provideCompletionSuggestions()
4141

4242
private function createCommandCompletionTester(): CommandCompletionTester
4343
{
44-
$dispatcher = new EventDispatcher();
45-
$otherDispatcher = new EventDispatcher();
46-
47-
$dispatcher->addListener('event', ['Listener']);
48-
$otherDispatcher->addListener('other_event', ['OtherListener']);
49-
5044
$dispatchers = new ServiceLocator([
5145
'event_dispatcher' => function () {
5246
$dispatcher = new EventDispatcher();

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ private function getUserProvider(ContainerBuilder $container, string $id, array
609609

610610
if ('remember_me' === $factoryKey || 'anonymous' === $factoryKey || 'custom_authenticators' === $factoryKey) {
611611
if ('custom_authenticators' === $factoryKey) {
612-
trigger_deprecation('symfony/security-bundle', '5.4', 'Not configuring explicitly the provider for the "%s" listener on "%s" firewall is deprecated because it\'s ambiguous as there is more than one registered provider.', $factoryKey, $id);
612+
trigger_deprecation('symfony/security-bundle', '5.4', 'Not configuring explicitly the provider for the "%s" firewall is deprecated because it\'s ambiguous as there is more than one registered provider. Set the "provider" key to one of the configured providers, even if your custom authenticators don\'t use it.', $id);
613613
}
614614

615615
return 'security.user_providers';

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function testFirewallWithNoUserProviderTriggerDeprecation()
339339
],
340340
]);
341341

342-
$this->expectDeprecation('Since symfony/security-bundle 5.4: Not configuring explicitly the provider for the "custom_authenticators" listener on "some_firewall" firewall is deprecated because it\'s ambiguous as there is more than one registered provider.');
342+
$this->expectDeprecation('Since symfony/security-bundle 5.4: Not configuring explicitly the provider for the "some_firewall" firewall is deprecated because it\'s ambiguous as there is more than one registered provider. Set the "provider" key to one of the configured providers, even if your custom authenticators don\'t use it.');
343343

344344
$container->compile();
345345
}

src/Symfony/Component/Console/Helper/ProcessHelper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ public function run(OutputInterface $output, array|Process $cmd, string $error =
8686
* This is identical to run() except that an exception is thrown if the process
8787
* exits with a non-zero exit code.
8888
*
89-
* @param string|Process $cmd An instance of Process or a command to run
90-
* @param callable|null $callback A PHP callback to run whenever there is some
91-
* output available on STDOUT or STDERR
89+
* @param array|Process $cmd An instance of Process or a command to run
90+
* @param callable|null $callback A PHP callback to run whenever there is some
91+
* output available on STDOUT or STDERR
9292
*
9393
* @throws ProcessFailedException
9494
*
9595
* @see run()
9696
*/
97 F438 -
public function mustRun(OutputInterface $output, string|Process $cmd, string $error = null, callable $callback = null): Process
97+
public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process
9898
{
9999
$process = $this->run($output, $cmd, $error, $callback);
100100

src/Symfony/Component/Translation/Tests/Command/TranslationPullCommandTest.php

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,83 @@ public function testPullMessagesWithDefaultLocale()
478478
, file_get_contents($filenameFr));
479479
}
480480

481+
public function testPullMessagesMultipleDomains()
482+
{
483+
$arrayLoader = new ArrayLoader();
484+
$filenameMessages = $this->createFile(['note' => 'NOTE']);
485+
$filenameDomain = $this->createFile(['note' => 'NOTE'], 'en', 'domain.%locale%.xlf');
486+
$locales = ['en'];
487+
$domains = ['messages', 'domain'];
488+
489+
$providerReadTranslatorBag = new TranslatorBag();
490+
$providerReadTranslatorBag->addCatalogue($arrayLoader->load([
491+
'new.foo' => 'newFoo',
492+
], 'en'));
493+
494+
$providerReadTranslatorBag->addCatalogue($arrayLoader->load([
495+
'new.foo' => 'newFoo',
496+
], 'en',
497+
'domain'
498+
));
499+
500+
$provider = $this->createMock(ProviderInterface::class);
501+
$provider->expects($this->once())
502+
->method('read')
503+
->with($domains, $locales)
504+
->willReturn($providerReadTranslatorBag);
505+
506+
$provider->expects($this->once())
507+
->method('__toString')
508+
->willReturn('null://default');
509+
510+
$tester = $this->createCommandTester($provider, $locales, $domains, 'en');
511+
$tester->execute(['--locales' => ['en'], '--domains' => ['messages', 'domain']]);
512+
513+
$this->assertStringContainsString('[OK] New translations from "null" has been written locally (for "en" locale(s), and "messages, domain" domain(s)).', trim($tester->getDisplay()));
514+
$this->assertXmlStringEqualsXmlString(<<<XLIFF
515+
<?xml version="1.0"?>
516+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
517+
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
518+
<header>
519+
<tool tool-id="symfony" tool-name="Symfony"/>
520+
</header>
521+
<body>
522+
<trans-unit id="994ixRL" resname="new.foo">
523+
<source>new.foo</source>
524+
<target>newFoo</target>
525+
</trans-unit>
526+
<trans-unit id="7bRlYkK" resname="note">
527+
<source>note</source>
528+
<target>NOTE</target>
529+
</trans-unit>
530+
</body>
531+
</file>
532+
</xliff>
533+
XLIFF
534+
, file_get_contents($filenameMessages));
535+
$this->assertXmlStringEqualsXmlString(<<<XLIFF
536+
<?xml version="1.0"?>
537+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
538+
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
539+
<header>
540+
<tool tool-id="symfony" tool-name="Symfony"/>
541+
</header>
542+
<body>
543+
<trans-unit id="994ixRL" resname="new.foo">
544+
<source>new.foo</source>
545+
<target>newFoo</target>
546+
</trans-unit>
547+
<trans-unit id="7bRlYkK" resname="note">
548+
<source>note</source>
549+
<target>NOTE</target>
550+
</trans-unit>
551+
</body>
552+
</file>
553+
</xliff>
554+
XLIFF
555+
, file_get_contents($filenameDomain));
556+
}
557+
481558
/**
482559
* @dataProvider provideCompletionSuggestions
483560
*/

0 commit comments

Comments
 (0)
0