Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / translation / Tests / Dumper / XliffFileDumperTest.php
index 5764dff540692aec2b9c411511eb009b6742dea8..738d4b3b2f1e660f838a685855ff932240d25542 100644 (file)
@@ -87,4 +87,29 @@ class XliffFileDumperTest extends TestCase
             $dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR'))
         );
     }
+
+    public function testFormatCatalogueWithNotesMetadata()
+    {
+        $catalogue = new MessageCatalogue('en_US');
+        $catalogue->add(array(
+            'foo' => 'bar',
+            'baz' => 'biz',
+        ));
+        $catalogue->setMetadata('foo', array('notes' => array(
+            array('category' => 'state', 'content' => 'new'),
+            array('category' => 'approved', 'content' => 'true'),
+            array('category' => 'section', 'content' => 'user login', 'priority' => '1'),
+        )));
+        $catalogue->setMetadata('baz', array('notes' => array(
+            array('id' => 'x', 'content' => 'x_content'),
+            array('appliesTo' => 'target', 'category' => 'quality', 'content' => 'Fuzzy'),
+        )));
+
+        $dumper = new XliffFileDumper();
+
+        $this->assertStringEqualsFile(
+            __DIR__.'/../fixtures/resources-notes-meta.xlf',
+            $dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR', 'xliff_version' => '2.0'))
+        );
+    }
 }