You are here

public function MessageCatalogueTest::testMetadataSetGetDelete in Zircon Profile 8

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

File

vendor/symfony/translation/Tests/MessageCatalogueTest.php, line 185

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
    ->assertNull($catalogue
    ->getMetadata('key2', 'messages'), 'Metadata key2 should is deleted.');
  $catalogue
    ->deleteMetadata('key2', 'domain');
  $this
    ->assertNull($catalogue
    ->getMetadata('key2', 'domain'), 'Metadata key2 should is deleted.');
}