]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / translation / Symfony / Component / Translation / Tests / Dumper / CsvFileDumperTest.php
CommitLineData
4f5b44bd
NL
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Translation\Tests\Dumper;
13
14use Symfony\Component\Translation\MessageCatalogue;
15use Symfony\Component\Translation\Dumper\CsvFileDumper;
16
17class CsvFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar', 'bar' => 'foo
23foo', 'foo;foo' => 'bar'));
24
25 $tempDir = sys_get_temp_dir();
26 $dumper = new CsvFileDumper();
27 $dumper->dump($catalogue, array('path' => $tempDir));
28
29 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/valid.csv'), file_get_contents($tempDir.'/messages.en.csv'));
30
31 unlink($tempDir.'/messages.en.csv');
32 }
33}