Completed
Push — EZP-26835-load-translation-pac... ( 513076...1a5c64 )
by Nicolas
12:39
created

GlobCollectorTest::testCollect()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 12
nc 2
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * File containing the class GlobCollectorTest extends \PHPUnit_Framework_TestCase
5
class.
6
 *
7
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
8
 * @license For full copyright and license information view LICENSE file distributed with this source code.
9
 */
10
namespace eZ\Bundle\EzPublishCoreBundle\Tests\Translation;
11
12
use eZ\Bundle\EzPublishCoreBundle\Translation\GlobCollector;
13
14
class GlobCollectorTest extends \PHPUnit_Framework_TestCase
15
{
16
    public function testCollect()
17
    {
18
        $translationRootDir = str_replace(
19
            sprintf('%1$sTests%1$sTranslation', DIRECTORY_SEPARATOR),
20
            sprintf('%1$sTests%1$sResources%1$sTranslation%1$svendor', DIRECTORY_SEPARATOR),
21
            __DIR__
22
        );
23
        $collector = new GlobCollector($translationRootDir);
24
25
        $files = $collector->collect();
26
        $this->assertEquals(3, count($files));
27
        foreach ($files as $file) {
28
            $this->assertTrue(in_array($file['domain'], ['messages', 'dashboard']));
29
            $this->assertTrue(in_array($file['locale'], ['fr', 'ach_UG']));
30
            $this->assertEquals($file['format'], 'xlf');
31
        }
32
    }
33
}
34