You are here

public function MessageCatalogueTest::testMetadataMerge in Plug 7

File

lib/Symfony/translation/Tests/MessageCatalogueTest.php, line 187

Class

MessageCatalogueTest

Namespace

Symfony\Component\Translation\Tests

Code

public function testMetadataMerge() {
  $cat1 = new MessageCatalogue('en');
  $cat1
    ->setMetadata('a', 'b');
  $this
    ->assertEquals(array(
    'messages' => array(
      'a' => 'b',
    ),
  ), $cat1
    ->getMetadata('', ''), 'Cat1 contains messages metadata.');
  $cat2 = new MessageCatalogue('en');
  $cat2
    ->setMetadata('b', 'c', 'domain');
  $this
    ->assertEquals(array(
    'domain' => array(
      'b' => 'c',
    ),
  ), $cat2
    ->getMetadata('', ''), 'Cat2 contains domain metadata.');
  $cat1
    ->addCatalogue($cat2);
  $this
    ->assertEquals(array(
    'messages' => array(
      'a' => 'b',
    ),
    'domain' => array(
      'b' => 'c',
    ),
  ), $cat1
    ->getMetadata('', ''), 'Cat1 contains merged metadata.');
}