You are here

public function XliffFileLoaderTest::testLoadNotes in Plug 7

File

lib/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
    ->assertNull($catalogue
    ->getMetadata('extra', 'domain1'));
  $this
    ->assertEquals(array(
    'notes' => array(
      array(
        'content' => 'baz',
      ),
      array(
        'priority' => 2,
        'from' => 'bar',
        'content' => 'qux',
      ),
    ),
  ), $catalogue
    ->getMetadata('key', 'domain1'));
}