Index: trunk/phase3/tests/phpunit/languages/LanguageTest.php |
— | — | @@ -658,10 +658,10 @@ |
659 | 659 | /** |
660 | 660 | * @dataProvider provideFormatDuration |
661 | 661 | */ |
662 | | - function testFormatDuration( $duration, $expected ) { |
| 662 | + function testFormatDuration( $duration, $expected, $intervals = array() ) { |
663 | 663 | $this->assertEquals( |
664 | 664 | $expected, |
665 | | - $this->lang->formatDuration( $duration ), |
| 665 | + $this->lang->formatDuration( $duration, $intervals ), |
666 | 666 | "formatDuration('$duration'): $expected" |
667 | 667 | ); |
668 | 668 | } |
— | — | @@ -752,6 +752,41 @@ |
753 | 753 | 42 * 1000 * 31557600 + 42, |
754 | 754 | '42 millennia and 42 seconds' |
755 | 755 | ), |
| 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 | + ), |
756 | 791 | ); |
757 | 792 | } |
758 | 793 | } |