SymfonyComponentTranslationTestsDumperJsonFileDumperTest

The Simple Calendar Symfony Component Translation Tests Dumper JsonFileDumperTest class.

Defined (1)

The class is defined in the following location(s).

/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php  
  1. class JsonFileDumperTest extends \PHPUnit_Framework_TestCase 
  2. public function testFormatCatalogue() 
  3. $catalogue = new MessageCatalogue('en'); 
  4. $catalogue->add(array('foo' => 'bar')); 
  5.  
  6. $dumper = new JsonFileDumper(); 
  7.  
  8. $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.json', $dumper->formatCatalogue($catalogue, 'messages')); 
  9.  
  10. public function testDumpWithCustomEncoding() 
  11. $catalogue = new MessageCatalogue('en'); 
  12. $catalogue->add(array('foo' => '"bar"')); 
  13.  
  14. $dumper = new JsonFileDumper(); 
  15.  
  16. $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.dump.json', $dumper->formatCatalogue($catalogue, 'messages', array('json_encoding' => JSON_HEX_QUOT)));