$expectedMessages[] =
[ 'id' => 'bar_ru',
'translation' => 'bar (ru)',
'locale' => 'en',
'fallbackLocale' => 'ru',
'domain' => 'messages',
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
'parameters' =>
['foo' => 'bar'
],
'transChoiceNumber' => null,
];
$this->
assertEquals($expectedMessages,
$collector->
getCollectedMessages());
} private function createCollector() { $translator =
new Translator('en'
);
$translator->
addLoader('array',
new ArrayLoader());
$translator->
addResource('array',
['foo' => 'foo (en)'
], 'en'
);
$translator->
addResource('array',
['bar' => 'bar (fr)'
], 'fr'
);
$translator->
addResource('array',
['bar_ru' => 'bar (ru)'
], 'ru'
);
return new DataCollectorTranslator($translator);
}