Test Setup Failed
Push — master ( c5c2a9...00574e )
by Dispositif
02:16
created

NumberUtilTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testArab2roman() 0 5 1
A provideArab2roman() 0 5 1
A testArab2romanLowerSize() 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
namespace App\Domain\Tests;
11
12
use App\Domain\Utils\NumberUtil;
13
use PHPUnit\Framework\TestCase;
14
15
class NumberUtilTest extends TestCase
16
{
17
    /**
18
     * @dataProvider provideArab2roman
19
     *
20
     * @param int    $number
21
     * @param string $expected
22
     */
23
    public function testArab2roman(int $number, ?string $expected)
24
    {
25
        $this::assertSame(
26
            $expected,
27
            NumberUtil::arab2roman($number)
28
        );
29
    }
30
31
    public function provideArab2roman(): array
32
    {
33
        return [
34
            [24, 'XXIV'],
35
            [-12, null],
36
        ];
37
    }
38
39
    public function testArab2romanLowerSize()
40
    {
41
        $this::assertSame(
42
            'xxiv',
43
            NumberUtil::arab2roman(24, true)
44
        );
45
    }
46
}
47