Skip to content

Commit dcf09d6

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: Fix TranslationTrait for multiple domains Fix parameter types for ProcessHelper::mustRun() Fix: Wording Remove return void PHPDoc in test
2 parents 6719fcd + 931a345 commit dcf09d6

File tree

4 files changed

+81
-5
lines changed

4 files changed

+81
-5
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
@@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7474
return 1;
7575
}
7676

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

7979
return 0;
8080
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl
9292
* This is identical to run() except that an exception is thrown if the process
9393
* exits with a non-zero exit code.
9494
*
95-
* @param string|Process $cmd An instance of Process or a command to run
96-
* @param callable|null $callback A PHP callback to run whenever there is some
97-
* output available on STDOUT or STDERR
95+
* @param array|Process $cmd An instance of Process or a command to run
96+
* @param callable|null $callback A PHP callback to run whenever there is some
97+
* output available on STDOUT or STDERR
9898
*
9999
* @return Process
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)