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')); }
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'); }