TranslationArrayTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A testTranslationArrayData() 0 11 1
A testAddTranslation() 0 10 1
1
<?php
2
3
class TranslationArrayTest extends \WebCMS\Tests\PresenterTestCase
4
{
5
    protected $translationArray;
6
7
    public function setUp()
8
    {
9
        parent::setUp();
10
11
        $translation = new \WebCMS\Translation\Translation($this->em, $this->language, true);
12
13
        $this->translationArray = new WebCMS\Translation\TranslationArray($translation);
14
    }
15
16
    public function testTranslationArrayData()
17
    {
18
        $data = array(
19
            'key' => 'Translated',
20
            'key2' => 'Translated second',
21
        );
22
23
        $this->translationArray->setData($data);
24
25
        $this->assertEquals($data, $this->translationArray->getData());
26
    }
27
28
    public function testAddTranslation()
29
    {
30
        $this->translationArray['key'];
31
32
        $this->assertEquals('key', $this->translationArray['key']);
33
34
        $this->translationArray['key'] = 'Translated';
35
36
        $this->assertEquals('Translated', $this->translationArray['key']);
37
    }
38
}
39