You are here

public function MessageCatalogueTest::testMetadataSetGetDelete in Plug 7

File

lib/Symfony/translation/Tests/MessageCatalogueTest.php, line 171

Class

MessageCatalogueTest

Namespace

Symfony\Component\Translation\Tests

Code

public function testMetadataSetGetDelete() {
  $catalogue = new MessageCatalogue('en');
  $catalogue
    ->setMetadata('key', 'value');
  $this
    ->assertEquals('value', $catalogue
    ->getMetadata('key', 'messages'), "Metadata 'key' = 'value'");
  $catalogue
    ->setMetadata('key2', array());
  $this
    ->assertEquals(array(), $catalogue
    ->getMetadata('key2', 'messages'), 'Metadata key2 is array');
  $catalogue
    ->deleteMetadata('key2', 'messages');
  $this
    ->assertEquals(null, $catalogue
    ->getMetadata('key2', 'messages'), 'Metadata key2 should is deleted.');
  $catalogue
    ->deleteMetadata('key2', 'domain');
  $this
    ->assertEquals(null, $catalogue
    ->getMetadata('key2', 'domain'), 'Metadata key2 should is deleted.');
}