Test Setup Failed
Push — master ( 13928a...35a0ba )
by Petr
03:24
created

FactorialTest::provideFactorialsWithResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace Tests;
4
5
use Vehsamrak\Factorial\Factorial;
6
7
class FactorialTest extends \PHPUnit_Framework_TestCase
8
{
9
10
    /**
11
     * @test
12
     * @dataProvider provideFactorialsWithResults
13
     */
14
    public function factorialize_numberToFactorialize_factorizationResult(int $numberToFactorialize, int $result): void
15
    {
16
        $factorial = new Factorial();
17
18
        $factorialResult = $factorial->factorialize($numberToFactorialize);
19
20
        $this->assertEquals($result, $factorialResult);
21
    }
22
23
    public function provideFactorialsWithResults(): array
24
    {
25
        return [
26
            [0, 1],
27
            [1, 1],
28
            [2, 2],
29
            [3, 6],
30
            [4, 24],
31
            [5, 120],
32
            [6, 720],
33
        ];
34
    }
35
}
36