Esempio n. 1
0
 public function testFormatCatalogue()
 {
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $dumper = new PhpFileDumper();
     $this->assertStringEqualsFile(__DIR__ . '/../fixtures/resources.php', $dumper->formatCatalogue($catalogue, 'messages'));
 }
Esempio n. 2
0
 public function testDump()
 {
     $catalogue = new MessageCatalogue('en');
     $catalogue->add(array('foo' => 'bar'));
     $tempDir = sys_get_temp_dir();
     $dumper = new PhpFileDumper();
     $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
     $this->assertEquals(file_get_contents(__DIR__ . '/../fixtures/resources.php'), file_get_contents($tempDir . '/messages.en.php'));
     unlink($tempDir . '/messages.en.php');
 }