Completed
Push — EZP-26835-load-translation-pac... ( f96c61 )
by Nicolas
15:15
created

CollectorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCollect() 0 14 2
1
<?php
2
3
/**
4
 * File containing the CollectorTest 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\Collector;
12
13
class CollectorTest extends \PHPUnit_Framework_TestCase
14
{
15
    public function testCollect()
16
    {
17
        $translationRootDir = str_replace('/Tests/Translation', '/Tests/Resources/Translation/vendor', __DIR__);
18
        $collector = new Collector($translationRootDir);
19
20
        $files = $collector->collect();
21
        $this->assertEquals(3, count($files));
22
        foreach ($files as $file) {
23
            $this->assertEquals(4, count($file));
24
            $this->assertTrue(in_array($file['domain'], ['messages', 'dashboard']));
25
            $this->assertTrue(in_array($file['locale'], ['fr', 'ach_UG']));
26
            $this->assertEquals($file['format'], 'xlf');
27
        }
28
    }
29
}
30