You are here

public function MergeOperationTest::testGetResultWithMetadata in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php \Symfony\Component\Translation\Tests\Catalogue\MergeOperationTest::testGetResultWithMetadata()

File

vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php, line 56

Class

MergeOperationTest

Namespace

Symfony\Component\Translation\Tests\Catalogue

Code

public function testGetResultWithMetadata() {
  $leftCatalogue = new MessageCatalogue('en', array(
    'messages' => array(
      'a' => 'old_a',
      'b' => 'old_b',
    ),
  ));
  $leftCatalogue
    ->setMetadata('a', 'foo', 'messages');
  $leftCatalogue
    ->setMetadata('b', 'bar', 'messages');
  $rightCatalogue = new MessageCatalogue('en', array(
    'messages' => array(
      'b' => 'new_b',
      'c' => 'new_c',
    ),
  ));
  $rightCatalogue
    ->setMetadata('b', 'baz', 'messages');
  $rightCatalogue
    ->setMetadata('c', 'qux', 'messages');
  $mergedCatalogue = new MessageCatalogue('en', array(
    'messages' => array(
      'a' => 'old_a',
      'b' => 'old_b',
      'c' => 'new_c',
    ),
  ));
  $mergedCatalogue
    ->setMetadata('a', 'foo', 'messages');
  $mergedCatalogue
    ->setMetadata('b', 'bar', 'messages');
  $mergedCatalogue
    ->setMetadata('c', 'qux', 'messages');
  $this
    ->assertEquals($mergedCatalogue, $this
    ->createOperation($leftCatalogue, $rightCatalogue)
    ->getResult());
}