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\Reader
;
14 use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader
;
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 class PhpBundleReaderTest
extends \PHPUnit_Framework_TestCase
22 * @var PhpBundleReader
26 protected function setUp()
28 $this->reader
= new PhpBundleReader();
31 public function testReadReturnsArray()
33 $data = $this->reader
->read(__DIR__
. '/Fixtures', 'en');
35 $this->assertTrue(is_array($data));
36 $this->assertSame('Bar', $data['Foo']);
37 $this->assertFalse(isset($data['ExistsNot']));
41 * @expectedException \Symfony\Component\Intl\Exception\InvalidArgumentException
43 public function testReadFailsIfLocaleOtherThanEn()
45 $this->reader
->read(__DIR__
. '/Fixtures', 'foo');
49 * @expectedException \Symfony\Component\Intl\Exception\RuntimeException
51 public function testReadFailsIfNonExistingDirectory()
53 $this->reader
->read(__DIR__
. '/foo', 'en');
57 * @expectedException \Symfony\Component\Intl\Exception\RuntimeException
59 public function testReadFailsIfNotAFile()
61 $this->reader
->read(__DIR__
. '/Fixtures/NotAFile', 'en');