summaryrefslogtreecommitdiff
path: root/vendor/symfony/console/Tests/Helper/HelperTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-10-25 16:22:10 -0700
committerFrederic Guillot <fred@kanboard.net>2017-10-25 16:22:10 -0700
commit9e2b2a32fd0e967ad3184e9a5d091a29953acb91 (patch)
tree00822e24aa1110c73ca455a8d096ef296c008cbc /vendor/symfony/console/Tests/Helper/HelperTest.php
parentc507c5416251c505cb3e088a03c6664bed73c812 (diff)
Include composer dependencies in repo
Diffstat (limited to 'vendor/symfony/console/Tests/Helper/HelperTest.php')
-rw-r--r--vendor/symfony/console/Tests/Helper/HelperTest.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/vendor/symfony/console/Tests/Helper/HelperTest.php b/vendor/symfony/console/Tests/Helper/HelperTest.php
new file mode 100644
index 00000000..33fa2205
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/HelperTest.php
@@ -0,0 +1,54 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\Helper;
+
+class HelperTest extends \PHPUnit_Framework_TestCase
+{
+ public function formatTimeProvider()
+ {
+ return array(
+ array(0, '< 1 sec'),
+ array(1, '1 sec'),
+ array(2, '2 secs'),
+ array(59, '59 secs'),
+ array(60, '1 min'),
+ array(61, '1 min'),
+ array(119, '1 min'),
+ array(120, '2 mins'),
+ array(121, '2 mins'),
+ array(3599, '59 mins'),
+ array(3600, '1 hr'),
+ array(7199, '1 hr'),
+ array(7200, '2 hrs'),
+ array(7201, '2 hrs'),
+ array(86399, '23 hrs'),
+ array(86400, '1 day'),
+ array(86401, '1 day'),
+ array(172799, '1 day'),
+ array(172800, '2 days'),
+ array(172801, '2 days'),
+ );
+ }
+
+ /**
+ * @dataProvider formatTimeProvider
+ *
+ * @param int $secs
+ * @param string $expectedFormat
+ */
+ public function testFormatTime($secs, $expectedFormat)
+ {
+ $this->assertEquals($expectedFormat, Helper::formatTime($secs));
+ }
+}