Completed
Push — master ( 511693...0349ad )
by Dispositif
04:19
created

LanguageTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideAll2wiki() 0 16 1
A testAll2wiki() 0 5 1
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application
4
 * 2019 © Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the LICENSE file.
6
 */
7
8
declare(strict_types=1);
9
10
11
namespace App\Domain\Enums;
12
13
use PHPUnit\Framework\TestCase;
14
15
class LanguageTest extends TestCase
16
{
17
18
    /**
19
     * @dataProvider provideAll2wiki
20
     */
21
    public function testAll2wiki($langStr, $expected)
22
    {
23
        $this::assertSame(
24
            $expected,
25
            Language::all2wiki($langStr)
26
        );
27
    }
28
29
    public function provideAll2wiki(): array
30
    {
31
        return [
32
            ['fr', 'fr'],
33
            ['FR', 'fr'],
34
            // iso
35
            ['dan', 'da'],
36
            ['DAN', 'da'],
37
            ['aav', null],
38
            ['coréen', 'ko'],
39
            ['anglais', 'en'],
40
            ['ANGLAIS', 'en'],
41
            ['English', 'en'],
42
            ['english', 'en'],
43
            ['ENGLISH', 'en'],
44
            ['Afrikaans', 'af'],
45
        ];
46
    }
47
}
48