use Symfony\Component\Translation\Loader\ArrayLoader;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Component\Translation\Translator;
class TranslatableTest extends TestCase
{ /**
* @dataProvider getTransTests
*/
public function testTrans(string
$expected, TranslatableMessage
$translatable, array
$translation, string
$locale) { $translator =
new Translator('en'
);
$translator->
addLoader('array',
new ArrayLoader());
$translator->
addResource('array',
$translation,
$locale,
$translatable->
getDomain());
$this->
assertSame($expected,
$translatable->
trans($translator,
$locale));
} /**
* @dataProvider getFlattenedTransTests
*/
public function testFlattenedTrans($expected,
$messages,
$translatable) {