Completed
Push — master ( 6a08aa...2252e8 )
by William
03:47
created

TranslatorTest::testSetTranslation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 5
c 2
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\MoTranslator\Tests;
6
7
use PhpMyAdmin\MoTranslator\Translator;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 * Test for translator API
12
 */
13
class TranslatorTest extends TestCase
14
{
15
    /**
16
     * Test on empty gettext
17
     */
18
    public function testGettext(): void
19
    {
20
        $translator = new Translator('');
21
        $this->assertEquals('Test', $translator->gettext('Test'));
22
    }
23
24
    /**
25
     * Test on empty gettext
26
     */
27
    public function testSetTranslation(): void
28
    {
29
        $translator = new Translator('');
30
        $translator->setTranslation('Test', 'Translation');
31
        $this->assertEquals('Translation', $translator->gettext('Test'));
32
    }
33
}
34