$translatorBag =
new TranslatorBag();
$translatorBag->
addCatalogue(new MessageCatalogue('en',
[ 'messages' =>
['a' => 'trans_en_a'
],
'validators' =>
['post.num_comments' => '{count, plural, one {# comment} other {# comments}}'
],
]));
$provider = self::
createProvider((new MockHttpClient($responses))->
withOptions([ 'base_uri' => 'https://api.crowdin.com/api/v2/projects/1/',
'auth_bearer' => 'API_TOKEN',
]),
$this->
getLoader(),
$this->
getLogger(),
$this->
getDefaultLocale(), 'api.crowdin.com/api/v2/projects/1/'
);
$provider->
write($translatorBag);
} public function testWriteAddFileServerError() { $this->xliffFileDumper =
new XliffFileDumper();
$expectedMessagesFileContent = <<<'XLIFF'
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
<header>
<tool tool-id="symfony" tool-name="Symfony"/>
</header>
<body>
<trans-unit id="ypeBEso" resname="a">
<source>a</source>
<target>trans_en_a</target>
</trans-unit>
</body>
</file>
</xliff>