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

NumberUtilTest::testArab2romanLowerSize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
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
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