wiki.techinc.nl/tests/phpunit/includes/languages/LanguageNlTest.php
Tim Starling 5e30a927bc tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.

Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.

Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
2023-03-24 02:53:57 +00:00

40 lines
889 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 static 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, '' ]
];
}
}