public function MessageCatalogueTest::testMetadataMerge in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/translation/Tests/MessageCatalogueTest.php \Symfony\Component\Translation\Tests\MessageCatalogueTest::testMetadataMerge()
File
- vendor/
symfony/ translation/ Tests/ MessageCatalogueTest.php, line 201
Class
Namespace
Symfony\Component\Translation\TestsCode
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.');
}