aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper')
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php33
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php37
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php32
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php31
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php32
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php31
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php32
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php32
-rw-r--r--vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php39
9 files changed, 299 insertions, 0 deletions
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
new file mode 100644
index 00000000..29177ff5
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
@@ -0,0 +1,33 @@
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}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
new file mode 100644
index 00000000..d187ef1d
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
@@ -0,0 +1,37 @@
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\IcuResFileDumper;
16
17class 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}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php
new file mode 100644
index 00000000..2a2cefde
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php
@@ -0,0 +1,32 @@
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\IniFileDumper;
16
17class IniFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar'));
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new IniFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27
28 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ini'), file_get_contents($tempDir.'/messages.en.ini'));
29
30 unlink($tempDir.'/messages.en.ini');
31 }
32}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php
new file mode 100644
index 00000000..439a25cd
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php
@@ -0,0 +1,31 @@
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\MoFileDumper;
16
17class MoFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar'));
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new MoFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.mo'), file_get_contents($tempDir.'/messages.en.mo'));
28
29 unlink($tempDir.'/messages.en.mo');
30 }
31}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php
new file mode 100644
index 00000000..18be5a0d
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php
@@ -0,0 +1,32 @@
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\PhpFileDumper;
16
17class PhpFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar'));
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new PhpFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27
28 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.php'), file_get_contents($tempDir.'/messages.en.php'));
29
30 unlink($tempDir.'/messages.en.php');
31 }
32}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php
new file mode 100644
index 00000000..0296d6b2
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php
@@ -0,0 +1,31 @@
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\PoFileDumper;
16
17class PoFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar'));
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new PoFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.po'), file_get_contents($tempDir.'/messages.en.po'));
28
29 unlink($tempDir.'/messages.en.po');
30 }
31}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php
new file mode 100644
index 00000000..d7d8fb7e
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php
@@ -0,0 +1,32 @@
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\QtFileDumper;
16
17class QtFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar'), 'resources');
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new QtFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27
28 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ts'), file_get_contents($tempDir.'/resources.en.ts'));
29
30 unlink($tempDir.'/resources.en.ts');
31 }
32}
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
new file mode 100644
index 00000000..bef31358
--- /dev/null
+++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
@@ -0,0 +1,32 @@
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\XliffFileDumper;
16
17class XliffFileDumperTest extends \PHPUnit_Framework_TestCase
18{
19 public function testDump()
20 {
21 $catalogue = new MessageCatalogue('en');
22 $catalogue->add(array('foo' => 'bar', 'key' => ''));
23
24 $tempDir = sys_get_temp_dir();
25 $dumper = new XliffFileDumper();
26 $dumper->dump($catalogue, array('path' => $tempDir));
27
28 $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources-clean.xlf'), file_get_contents($tempDir.'/messages.en.xlf'));
29
30 unlink($tempDir.'/messages.en.xlf');
31 }
32}
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
12namespace Symfony\Component\Translation\Tests\Dumper;
13
14use Symfony\Component\Translation\MessageCatalogue;
15use Symfony\Component\Translation\Dumper\YamlFileDumper;
16
17class 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}