DurationTest::dataGetDefaultString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
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