diff options
Diffstat (limited to 'vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php')
-rw-r--r-- | vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php new file mode 100644 index 00000000..e4e68e02 --- /dev/null +++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php | |||
@@ -0,0 +1,39 @@ | |||
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\YamlFileDumper; | ||
16 | |||
17 | class YamlFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Yaml\Yaml')) { | ||
22 | $this->markTestSkipped('The "Yaml" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testDump() | ||
27 | { | ||
28 | $catalogue = new MessageCatalogue('en'); | ||
29 | $catalogue->add(array('foo' => 'bar')); | ||
30 | |||
31 | $tempDir = sys_get_temp_dir(); | ||
32 | $dumper = new YamlFileDumper(); | ||
33 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
34 | |||
35 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.yml'), file_get_contents($tempDir.'/messages.en.yml')); | ||
36 | |||
37 | unlink($tempDir.'/messages.en.yml'); | ||
38 | } | ||
39 | } | ||