Completed
Push — master ( 0349ad...e37ca9 )
by Dispositif
02:28
created

NumberUtilTest::provideArab2roman()   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 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
     * @param int    $number
20
     * @param string $expected
21
     */
22
    public function testArab2roman(int $number, ?string $expected)
23
    {
24
        $this::assertSame(
25
            $expected,
26
            NumberUtil::arab2roman($number)
27
        );
28
    }
29
30
    public function provideArab2roman(): array
31
    {
32
        return [
33
            [24, 'XXIV'],
34
            [-12, null],
35
        ];
36
    }
37
}
38