You are here

public function MessageCatalogueTest::testAdd in Plug 7

File

lib/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'));
}