8000 Add test file, adjust test to be accord with the file · symfony/symfony@87b69dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 87b69dc

Browse files
committed
Add test file, adjust test to be accord with the file
1 parent cc2d2f1 commit 87b69dc

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ public function testDumpCatalogueWithXliffExtension()
134134
$catalogue = new MessageCatalogue('en_US');
135135
$catalogue->add([
136136
'foo' => 'bar',
137+
'key' => '',
138+
'key.with.cdata' => '<source> & <target>',
137139
]);
140+
$catalogue->setMetadata('foo', ['notes' => [['priority' => 1, 'from' => 'bar', 'content' => 'baz']]]);
141+
$catalogue->setMetadata('key', ['notes' => [['content' => 'baz'], ['content' => 'qux']]]);
138142

139143
$dumper = new XliffFileDumper('xliff');
140144

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3+
<file source-language="fr-FR" target-language="en-US" datatype="plaintext" original="file.ext">
4+
<header>
5+
<tool tool-id="symfony" tool-name="Symfony"/>
6+
</header>
7+
<body>
8+
<trans-unit id="LCa0a2j" resname="foo">
9+
<source>foo</source>
10+
<target>bar</target>
11+
<note priority="1" from="bar">baz</note>
12+
</trans-unit>
13+
<trans-unit id="LHDhK3o" resname="key">
14+
<source>key</source>
15+
<target></target>
16+
<note>baz</note>
17+
<note>qux</note>
18+
</trans-unit>
19+
<trans-unit id="2DA_bnh" resname="key.with.cdata">
20+
<source>key.with.cdata</source>
21+
<target><![CDATA[<source> & <target>]]></target>
22+
</trans-unit>
23+
</body>
24+
</file>
25+
</xliff>

0 commit comments

Comments
 (0)
0