https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114322

Revision: 114322
Author:   jeroendedauw
Date:     2012-03-20 22:48:28 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
added some tests using the intervals param

Modified Paths:
--------------
    trunk/phase3/tests/phpunit/languages/LanguageTest.php

Modified: trunk/phase3/tests/phpunit/languages/LanguageTest.php
===================================================================
--- trunk/phase3/tests/phpunit/languages/LanguageTest.php       2012-03-20 
22:47:50 UTC (rev 114321)
+++ trunk/phase3/tests/phpunit/languages/LanguageTest.php       2012-03-20 
22:48:28 UTC (rev 114322)
@@ -658,10 +658,10 @@
        /**
         * @dataProvider provideFormatDuration
         */
-       function testFormatDuration( $duration, $expected ) {
+       function testFormatDuration( $duration, $expected, $intervals = array() 
) {
                $this->assertEquals(
                        $expected,
-                       $this->lang->formatDuration( $duration ),
+                       $this->lang->formatDuration( $duration, $intervals ),
                        "formatDuration('$duration'): $expected"
                );
        }
@@ -752,6 +752,41 @@
                                42 * 1000 * 31557600 + 42,
                                '42 millennia and 42 seconds'
                        ),
+                       array(
+                               60,
+                               '60 seconds',
+                               array( 'seconds' ),
+                       ),
+                       array(
+                               61,
+                               '61 seconds',
+                               array( 'seconds' ),
+                       ),
+                       array(
+                               1,
+                               '1 second',
+                               array( 'seconds' ),
+                       ),
+                       array(
+                               31557600 + 2 * 86400 + 9000,
+                               '1 year, 2 days and 150 minutes',
+                               array( 'years', 'days', 'minutes' ),
+                       ),
+                       array(
+                               42,
+                               '0 days',
+                               array( 'years', 'days' ),
+                       ),
+                       array(
+                               31557600 + 2 * 86400 + 9000,
+                               '1 year, 2 days and 150 minutes',
+                               array( 'minutes', 'days', 'years' ),
+                       ),
+                       array(
+                               42,
+                               '0 days',
+                               array( 'days', 'years' ),
+                       ),
                );
        }
 }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to