You are here

public function XliffFileLoaderTest::testLoadNotes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php \Symfony\Component\Translation\Tests\Loader\XliffFileLoaderTest::testLoadNotes()

File

vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php, line 132

Class

XliffFileLoaderTest

Namespace

Symfony\Component\Translation\Tests\Loader

Code

public function testLoadNotes() {
  $loader = new XliffFileLoader();
  $catalogue = $loader
    ->load(__DIR__ . '/../fixtures/withnote.xlf', 'en', 'domain1');
  $this
    ->assertEquals(array(
    'notes' => array(
      array(
        'priority' => 1,
        'content' => 'foo',
      ),
    ),
  ), $catalogue
    ->getMetadata('foo', 'domain1'));

  // message without target
  $this
    ->assertEquals(array(
    'notes' => array(
      array(
        'content' => 'bar',
        'from' => 'foo',
      ),
    ),
  ), $catalogue
    ->getMetadata('extra', 'domain1'));

  // message with empty target
  $this
    ->assertEquals(array(
    'notes' => array(
      array(
        'content' => 'baz',
      ),
      array(
        'priority' => 2,
        'from' => 'bar',
        'content' => 'qux',
      ),
    ),
  ), $catalogue
    ->getMetadata('key', 'domain1'));
}