use Symfony\Component\Translation\Loader\ArrayLoader;
use Symfony\Component\Translation\Translator;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
use Twig\Loader\ArrayLoader
as TwigArrayLoader;
use Twig\TemplateWrapper;
class TranslationExtensionTest extends TestCase
{ public function testEscaping() { $output =
$this->
getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}'
)->
render(['value' => 12, 'msg' => 'approx.'
]);
$this->
assertEquals('Percent: 12% (approx.)',
$output);
} /**
* @dataProvider getTransTests
*/
public function testTrans($template,
$expected, array
$variables =
[]) { if ($expected !=
$this->
getTemplate($template)->
render($variables)) { echo $template."\n";