Depending on which namespace we want these classes to have after T166010 they could either stay in includes/languages/ (plural) in their own MediaWiki\Languages\-namespace dedicated to Language subclasses, or they could go in into a subdirectory like `includes/language/languages/` if we want to keep them in the same top-level namespace as other Language classes and services, but in a more nested namespace. For now, I've made the smaller change and kept the Language subclasses in their own directory directly under includes/, not nested further. Bug: T225756 Change-Id: I01015424707b442853879fd50c97f00215e5c2fa
40 lines
882 B
PHP
40 lines
882 B
PHP
<?php
|
||
/**
|
||
* @author Santhosh Thottingal
|
||
* @copyright Copyright © 2011, Santhosh Thottingal
|
||
* @file
|
||
*/
|
||
|
||
/**
|
||
* @group Language
|
||
*/
|
||
class LanguageNlTest extends LanguageClassesTestCase {
|
||
|
||
/**
|
||
* @covers Language::formatNum
|
||
* @dataProvider provideFormatNum
|
||
*/
|
||
public function testFormatNum( $unformatted, $formatted ) {
|
||
$this->assertEquals( $formatted, $this->getLang()->formatNum( $unformatted ) );
|
||
}
|
||
|
||
public function provideFormatNum() {
|
||
return [
|
||
[ '1234567', '1.234.567' ],
|
||
[ '12345', '12.345' ],
|
||
[ '1', '1' ],
|
||
[ '123', '123' ],
|
||
[ '1234', '1.234' ],
|
||
[ '12345.56', '12.345,56' ],
|
||
[ '.1234556', ',1234556' ],
|
||
[ '12345679812345678', '12.345.679.812.345.678' ],
|
||
[ '.12345', ',12345' ],
|
||
[ '-1200000', '−1.200.000' ],
|
||
[ '-98', '−98' ],
|
||
[ -98, '−98' ],
|
||
[ -12345678, '−12.345.678' ],
|
||
[ '', '' ],
|
||
[ null, '' ]
|
||
];
|
||
}
|
||
}
|