r114322 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114321‎ | r114322 | r114323 >
Date:22:48, 20 March 2012
Author:jeroendedauw
Status:reverted
Tags:gerritmigration 
Comment:
added some tests using the intervals param
Modified paths:
  • /trunk/phase3/tests/phpunit/languages/LanguageTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/languages/LanguageTest.php
@@ -658,10 +658,10 @@
659659 /**
660660 * @dataProvider provideFormatDuration
661661 */
662 - function testFormatDuration( $duration, $expected ) {
 662+ function testFormatDuration( $duration, $expected, $intervals = array() ) {
663663 $this->assertEquals(
664664 $expected,
665 - $this->lang->formatDuration( $duration ),
 665+ $this->lang->formatDuration( $duration, $intervals ),
666666 "formatDuration('$duration'): $expected"
667667 );
668668 }
@@ -752,6 +752,41 @@
753753 42 * 1000 * 31557600 + 42,
754754 '42 millennia and 42 seconds'
755755 ),
 756+ array(
 757+ 60,
 758+ '60 seconds',
 759+ array( 'seconds' ),
 760+ ),
 761+ array(
 762+ 61,
 763+ '61 seconds',
 764+ array( 'seconds' ),
 765+ ),
 766+ array(
 767+ 1,
 768+ '1 second',
 769+ array( 'seconds' ),
 770+ ),
 771+ array(
 772+ 31557600 + 2 * 86400 + 9000,
 773+ '1 year, 2 days and 150 minutes',
 774+ array( 'years', 'days', 'minutes' ),
 775+ ),
 776+ array(
 777+ 42,
 778+ '0 days',
 779+ array( 'years', 'days' ),
 780+ ),
 781+ array(
 782+ 31557600 + 2 * 86400 + 9000,
 783+ '1 year, 2 days and 150 minutes',
 784+ array( 'minutes', 'days', 'years' ),
 785+ ),
 786+ array(
 787+ 42,
 788+ '0 days',
 789+ array( 'days', 'years' ),
 790+ ),
756791 );
757792 }
758793 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r114326Revert r114067, r114071, r114075, r114079, r114081, r114082, r114084, r114086......catrope23:03, 20 March 2012

Status & tagging log