/**
* @dataProvider getResponsesForOneLocaleAndOneDomain
*/
public function testReadForOneLocaleAndOneDomain(string
$locale, string
$domain, string
$responseContent, TranslatorBag
$expectedTranslatorBag) { $loader =
$this->
getLoader();
$loader->
expects($this->
once()) ->
method('load'
) ->
willReturn((new XliffFileLoader())->
load($responseContent,
$locale,
$domain));
$this->
getTranslatorBag()->
expects($this->
any()) ->
method('getCatalogue'
) ->
willReturn(new MessageCatalogue($locale));
$provider = self::
createProvider((new MockHttpClient(new MockResponse($responseContent)))->
withOptions([ 'base_uri' => 'https://localise.biz/api/',
'headers' =>
[ 'Authorization' => 'Loco API_KEY',
],
]),
$loader,
new NullLogger(), 'en', 'localise.biz/api/'
);
$translatorBag =
$provider->
read([$domain],
[$locale]);
// We don't want to assert equality of metadata here, due to the ArrayLoader usage.