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

LanguageTest::testAll2wiki()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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