8000 Add tests · symfony/symfony@8043038 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8043038

Browse files
committed
Add tests
1 parent 02614ef commit 8043038

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ public function testFormatCatalogueXliff2()
5454
);
5555
}
5656

57+
public function testFormatIcuCatalogueXliff2()
58+
{
59+
$catalogue = new MessageCatalogue('en_US');
60+
$catalogue->add([
61+
'foo' => 'bar',
62+
]);
63+
64+
$dumper = new XliffFileDumper();
65+
66+
$this->assertStringEqualsFile(
67+
__DIR__.'/../fixtures/resources-2.0+intl-icu.xlf',
68+
$dumper->formatCatalogue($catalogue, 'messages'.MessageCatalogue::INTL_DOMAIN_SUFFIX, ['default_locale' => 'fr_FR', 'xliff_version' => '2.0'])
69+
);
70+
}
71+
5772
public function testFormatCatalogueWithCustomToolInfo()
5873
{
5974
$options = [
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr-FR" trgLang="en-US">
3+
<file id="messages.en_US">
4+
<unit id="LCa0a2j" name="foo">
5+
<segment>
6+
<source>foo</source>
7+
<target>bar</target>
8+
</segment>
9+
</unit>
10+
</file>
11+
</xliff>

0 commit comments

Comments
 (0)
0