]>
Commit | Line | Data |
---|---|---|
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 | ||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | |
13 | ||
14 | use Symfony\Component\Translation\MessageCatalogue; | |
15 | use Symfony\Component\Translation\Dumper\IcuResFileDumper; | |
16 | ||
17 | class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase | |
18 | { | |
19 | public function testDump() | |
20 | { | |
21 | if (!extension_loaded('mbstring')) { | |
22 | $this->markTestSkipped('This test requires mbstring to work.'); | |
23 | } | |
24 | ||
25 | $catalogue = new MessageCatalogue('en'); | |
26 | $catalogue->add(array('foo' => 'bar')); | |
27 | ||
28 | $tempDir = sys_get_temp_dir(); | |
29 | $dumper = new IcuResFileDumper(); | |
30 | $dumper->dump($catalogue, array('path' => $tempDir)); | |
31 | ||
32 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir.'/messages/en.res')); | |
33 | ||
34 | unlink($tempDir.'/messages/en.res'); | |
35 | rmdir($tempDir.'/messages'); | |
36 | } | |
37 | } |