]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / intl / Symfony / Component / Intl / Tests / ResourceBundle / Reader / BinaryBundleReaderTest.php
CommitLineData
4f5b44bd
NL
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}