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\PhpBundleWriter
;
18 * @author Bernhard Schussek <bschussek@gmail.com>
20 class PhpBundleWriterTest
extends \PHPUnit_Framework_TestCase
23 * @var PhpBundleWriter
34 protected function setUp()
36 $this->writer
= new PhpBundleWriter();
37 $this->directory
= sys_get_temp_dir() . '/PhpBundleWriterTest/' . rand(1000, 9999);
38 $this->filesystem
= new Filesystem();
40 $this->filesystem
->mkdir($this->directory
);
43 protected function tearDown()
45 $this->filesystem
->remove($this->directory
);
48 public function testWrite()
50 $this->writer
->write($this->directory
, 'en', array(
52 'Array' => array('foo', 'bar'),
60 $this->assertFileEquals(__DIR__
. '/Fixtures/en.php', $this->directory
. '/en.php');