getAllMessagesFromTranslatorBag example

use Symfony\Component\Translation\TranslatorBag;

class TranslatorBagTest extends TestCase
{
    public function testAll()
    {
        $catalogue = new MessageCatalogue('en', $messages = ['domain1' => ['foo' => 'foo'], 'domain2' => ['bar' => 'bar']]);

        $bag = new TranslatorBag();
        $bag->addCatalogue($catalogue);

        $this->assertEquals(['en' => $messages]$this->getAllMessagesFromTranslatorBag($bag));

        $messages = ['domain1+intl-icu' => ['foo' => 'bar']] + $messages + [
                'domain2+intl-icu' => ['bar' => 'foo'],
                'domain3+intl-icu' => ['biz' => 'biz'],
            ];
        $catalogue = new MessageCatalogue('en', $messages);

        $bag = new TranslatorBag();
        $bag->addCatalogue($catalogue);

        $this->assertEquals([
            
Home | Imprint | This part of the site doesn't use cookies.