You are here

public function MessageCatalogueTest::testAdd in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Tests/MessageCatalogueTest.php \Symfony\Component\Translation\Tests\MessageCatalogueTest::testAdd()

File

vendor/symfony/translation/Tests/MessageCatalogueTest.php, line 59

Class

MessageCatalogueTest

Namespace

Symfony\Component\Translation\Tests

Code

public function testAdd() {
  $catalogue = new MessageCatalogue('en', array(
    'domain1' => array(
      'foo' => 'foo',
    ),
    'domain2' => array(
      'bar' => 'bar',
    ),
  ));
  $catalogue
    ->add(array(
    'foo1' => 'foo1',
  ), 'domain1');
  $this
    ->assertEquals('foo', $catalogue
    ->get('foo', 'domain1'));
  $this
    ->assertEquals('foo1', $catalogue
    ->get('foo1', 'domain1'));
  $catalogue
    ->add(array(
    'foo' => 'bar',
  ), 'domain1');
  $this
    ->assertEquals('bar', $catalogue
    ->get('foo', 'domain1'));
  $this
    ->assertEquals('foo1', $catalogue
    ->get('foo1', 'domain1'));
  $catalogue
    ->add(array(
    'foo' => 'bar',
  ), 'domain88');
  $this
    ->assertEquals('bar', $catalogue
    ->get('foo', 'domain88'));
}