'addFile2' =>
function Dstring
$method, string
$url, array
$options =
[]): ResponseInterface
{ $this->
assertSame('POST',
$method);
$this->
assertSame('https://api.crowdin.com/api/v2/projects/1/files',
$url);
$this->
assertSame('{"storageId":19,"name":"validators.xlf"}',
$options['body'
]);
return new MockResponse(json_encode(['data' =>
['id' => 200, 'name' => 'validators.xlf'
]]));
},
];
$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);
}