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

GlobCollectorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCollect() 0 17 2
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