aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php')
-rw-r--r--vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php
new file mode 100644
index 00000000..3aefbae7
--- /dev/null
+++ b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php
@@ -0,0 +1,58 @@
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\Intl\Tests\ResourceBundle\Reader;
13
14use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader;
15use Symfony\Component\Intl\Util\IntlTestHelper;
16
17/**
18 * @author Bernhard Schussek <bschussek@gmail.com>
19 */
20class BinaryBundleReaderTest extends \PHPUnit_Framework_TestCase
21{
22 /**
23 * @var BinaryBundleReader
24 */
25 private $reader;
26
27 protected function setUp()
28 {
29 IntlTestHelper::requireFullIntl($this);
30
31 $this->reader = new BinaryBundleReader();
32 }
33
34 public function testReadReturnsArrayAccess()
35 {
36 $data = $this->reader->read(__DIR__ . '/Fixtures', 'en');
37
38 $this->assertInstanceOf('\ArrayAccess', $data);
39 $this->assertSame('Bar', $data['Foo']);
40 $this->assertFalse(isset($data['ExistsNot']));
41 }
42
43 /**
44 * @expectedException \Symfony\Component\Intl\Exception\RuntimeException
45 */
46 public function testReadFailsIfNonExistingLocale()
47 {
48 $this->reader->read(__DIR__ . '/Fixtures', 'foo');
49 }
50
51 /**
52 * @expectedException \Symfony\Component\Intl\Exception\RuntimeException
53 */
54 public function testReadFailsIfNonExistingDirectory()
55 {
56 $this->reader->read(__DIR__ . '/foo', 'en');
57 }
58}