DurationTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetDefaultString() 0 4 1
A dataGetDefaultString() 0 7 1
1
<?php
2
3
namespace Nip\Utility\Tests\Time;
4
5
use Nip\Utility\Tests\AbstractTest;
6
use Nip\Utility\Time\Duration;
7
8
/**
9
 * Class DurationTest
10
 * @package Nip\Utility\Tests\Time
11
 */
12
class DurationTest extends AbstractTest
13
{
14
    /**
15
     * @param $seconds
16
     * @param $formatted
17
     * @dataProvider dataGetDefaultString
18
     */
19
    public function testGetDefaultString($seconds, $formatted)
20
    {
21
        $duration = new Duration($seconds);
22
        self::assertEquals($formatted, $duration->getDefaultString());
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function dataGetDefaultString()
29
    {
30
        return [
31
            [123, '00:02:03.00'],
32
            [123.56, '00:02:03.56'],
33
            [123.06, '00:02:03.06'],
34
            [94123.061, '26:08:43.06'],
35
        ];
36
    }
37
}
38