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