Exemple #1
0
 public function testFormatCatalogue()
 {
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $dumper = new IcuResFileDumper();
     $this->assertStringEqualsFile(__DIR__ . '/../fixtures/resourcebundle/res/en.res', $dumper->formatCatalogue($catalogue, 'messages'));
 }
 public function testFormatCatalogue()
 {
     if (!function_exists('mb_convert_encoding')) {
         $this->markTestSkipped('This test requires mbstring to work.');
     }
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $dumper = new IcuResFileDumper();
     $this->assertStringEqualsFile(__DIR__ . '/../fixtures/resourcebundle/res/en.res', $dumper->formatCatalogue($catalogue, 'messages'));
 }
 public function testDump()
 {
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $tempDir = sys_get_temp_dir();
     $dumper = new IcuResFileDumper();
     $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
     $this->assertEquals(file_get_contents(__DIR__ . '/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir . '/messages/en.res'));
     unlink($tempDir . '/messages/en.res');
     rmdir($tempDir . '/messages');
 }
 public function testDump()
 {
     if (!extension_loaded('mbstring')) {
         $this->markTestSkipped('This test requires mbstring to work.');
     }
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $tempDir = sys_get_temp_dir();
     $dumper = new IcuResFileDumper();
     $dumper->dump($catalogue, array('path' => $tempDir));
     $this->assertEquals(file_get_contents(__DIR__ . '/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir . '/messages/en.res'));
     unlink($tempDir . '/messages/en.res');
     rmdir($tempDir . '/messages');
 }