Completed
Push — master ( caa73d...02f995 )
by Nicolas
12:43
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 class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Bundle\EzPublishCoreBundle\Tests\Translation;
10
11
use eZ\Bundle\EzPublishCoreBundle\Translation\GlobCollector;
12
13
class GlobCollectorTest extends \PHPUnit_Framework_TestCase
14
{
15
    public function testCollect()
16
    {
17
        $translationRootDir = str_replace(
18
            sprintf('%1$sTests%1$sTranslation', DIRECTORY_SEPARATOR),
19
            sprintf('%1$sTests%1$sResources%1$sTranslation%1$svendor', DIRECTORY_SEPARATOR),
20
            __DIR__
21
        );
22
        $collector = new GlobCollector($translationRootDir);
23
24
        $files = $collector->collect();
25
        $this->assertEquals(3, count($files));
26
        foreach ($files as $file) {
27
            $this->assertTrue(in_array($file['domain'], ['messages', 'dashboard']));
28
            $this->assertTrue(in_array($file['locale'], ['fr', 'ach_UG']));
29
            $this->assertEquals($file['format'], 'xlf');
30
        }
31
    }
32
}
33