Yaffs site version 1.1
[yaffs-website] / vendor / symfony / console / Tests / Helper / HelperTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Console\Tests\Helper;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Console\Helper\Helper;
16
17 class HelperTest extends TestCase
18 {
19     public function formatTimeProvider()
20     {
21         return array(
22             array(0,      '< 1 sec'),
23             array(1,      '1 sec'),
24             array(2,      '2 secs'),
25             array(59,     '59 secs'),
26             array(60,     '1 min'),
27             array(61,     '1 min'),
28             array(119,    '1 min'),
29             array(120,    '2 mins'),
30             array(121,    '2 mins'),
31             array(3599,   '59 mins'),
32             array(3600,   '1 hr'),
33             array(7199,   '1 hr'),
34             array(7200,   '2 hrs'),
35             array(7201,   '2 hrs'),
36             array(86399,  '23 hrs'),
37             array(86400,  '1 day'),
38             array(86401,  '1 day'),
39             array(172799, '1 day'),
40             array(172800, '2 days'),
41             array(172801, '2 days'),
42         );
43     }
44
45     /**
46      * @dataProvider formatTimeProvider
47      *
48      * @param int    $secs
49      * @param string $expectedFormat
50      */
51     public function testFormatTime($secs, $expectedFormat)
52     {
53         $this->assertEquals($expectedFormat, Helper::formatTime($secs));
54     }
55 }