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

TranslatorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 19
c 2
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGettext() 0 4 1
A testSetTranslation() 0 5 1
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