Skip to content

Commit

Permalink
Conditionally inject message selector
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Nov 4, 2017
1 parent c3d0fd9 commit 5238787
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tests/Twig/Extension/SonataAdminExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\Loader\XmlFileLoader;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Translation\DependencyInjection\TranslationDumperPass;
use Symfony\Component\Translation\Loader\XliffFileLoader;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Translator;
Expand Down Expand Up @@ -117,7 +118,11 @@ public function setUp()
];

// translation extension
$translator = new Translator('en', new MessageSelector());
$translator = new Translator(
'en',
// NEXT_MAJOR: simplify this when dropping symfony < 3.4
class_exists(TranslationDumperPass::class) ? null : new MessageSelector()
);
$translator->addLoader('xlf', new XliffFileLoader());
$translator->addResource(
'xlf',
Expand Down

0 comments on commit 5238787

Please sign in to comment.