diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
commit | 4f5b44bd3bd490309eb2ba7b44df4769816ba729 (patch) | |
tree | 6cefe170dfe0a5a361cb1e2d1fc4d580a3316d02 /vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php | |
parent | 2b840e0cfb63a453bea67a98541f3df9c273c5f5 (diff) | |
download | wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.gz wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.zst wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.zip |
twig implementation
Diffstat (limited to 'vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php')
-rw-r--r-- | vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php new file mode 100644 index 00000000..ae1289d0 --- /dev/null +++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php | |||
@@ -0,0 +1,57 @@ | |||
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 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\IniFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class IniFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new IniFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.ini'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | public function testLoadDoesNothingIfEmpty() | ||
38 | { | ||
39 | $loader = new IniFileLoader(); | ||
40 | $resource = __DIR__.'/../fixtures/empty.ini'; | ||
41 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
42 | |||
43 | $this->assertEquals(array(), $catalogue->all('domain1')); | ||
44 | $this->assertEquals('en', $catalogue->getLocale()); | ||
45 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
50 | */ | ||
51 | public function testLoadNonExistingResource() | ||
52 | { | ||
53 | $loader = new IniFileLoader(); | ||
54 | $resource = __DIR__.'/../fixtures/non-existing.ini'; | ||
55 | $loader->load($resource, 'en', 'domain1'); | ||
56 | } | ||
57 | } | ||