4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\Tests\ResourceBundle\Writer
;
14 use Symfony\Component\Filesystem\Filesystem
;
15 use Symfony\Component\Intl\ResourceBundle\Writer\TextBundleWriter
;
18 * @author Bernhard Schussek <bschussek@gmail.com>
20 * @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
22 class TextBundleWriterTest
extends \PHPUnit_Framework_TestCase
25 * @var TextBundleWriter
36 protected function setUp()
38 $this->writer
= new TextBundleWriter();
39 $this->directory
= sys_get_temp_dir() . '/TextBundleWriterTest/' . rand(1000, 9999);
40 $this->filesystem
= new Filesystem();
42 $this->filesystem
->mkdir($this->directory
);
45 protected function tearDown()
47 $this->filesystem
->remove($this->directory
);
50 public function testWrite()
52 $this->writer
->write($this->directory
, 'en', array(
54 'Array' => array('foo', 'bar', array('Key' => 'value')),
56 'IntVector' => array(0, 1, 2, 3),
57 'FalseBoolean' => false,
58 'TrueBoolean' => true,
65 $this->assertFileEquals(__DIR__
. '/Fixtures/en.txt', $this->directory
. '/en.txt');