You are here

public function DiffOperationTest::testGetResultWithMetadata in Zircon Profile 8

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

File

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

Class

DiffOperationTest

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');
  $diffCatalogue = new MessageCatalogue('en', array(
    'messages' => array(
      'b' => 'old_b',
      'c' => 'new_c',
    ),
  ));
  $diffCatalogue
    ->setMetadata('b', 'bar', 'messages');
  $diffCatalogue
    ->setMetadata('c', 'qux', 'messages');
  $this
    ->assertEquals($diffCatalogue, $this
    ->createOperation($leftCatalogue, $rightCatalogue)
    ->getResult());
}