TranslationArrayTest::testAddTranslation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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