Merge "Remove not needed int type from ReferenceListFormatter"

This commit is contained in:
jenkins-bot 2024-08-27 09:37:49 +00:00 committed by Gerrit Code Review
commit 9fb20ec09a
2 changed files with 10 additions and 9 deletions

View file

@ -241,14 +241,14 @@ class ReferenceListFormatter {
* offset, e.g. $base = 1, $offset = 2; = 1.2
* Since bug #5525, it correctly does 1.9 -> 1.10 as well as 1.099 -> 1.100
*
* @param int|string $base
* @param string $base
* @param int $offset
* @param int $max Maximum value expected.
*
* @return string
*/
private function referencesFormatEntryNumericBacklinkLabel(
$base,
string $base,
int $offset,
int $max
): string {

View file

@ -389,10 +389,10 @@ class ReferenceListFormatterTest extends \MediaWikiUnitTestCase {
* @dataProvider provideReferencesFormatEntryNumericBacklinkLabel
*/
public function testReferencesFormatEntryNumericBacklinkLabel(
string $expectedLabel, int $base, int $offset, int $max
string $expectedLabel, string $base, int $offset, int $max
) {
$mockMessageLocalizer = $this->createMock( ReferenceMessageLocalizer::class );
$mockMessageLocalizer->method( 'localizeSeparators' )->willReturnArgument( 0 );
$mockMessageLocalizer->method( 'localizeSeparators' )->willReturn( ',' );
$mockMessageLocalizer->method( 'localizeDigits' )->willReturnArgument( 0 );
/** @var ReferenceListFormatter $formatter */
@ -407,11 +407,12 @@ class ReferenceListFormatterTest extends \MediaWikiUnitTestCase {
}
public static function provideReferencesFormatEntryNumericBacklinkLabel() {
yield [ '1.2', 1, 2, 9 ];
yield [ '1.02', 1, 2, 99 ];
yield [ '1.002', 1, 2, 100 ];
yield [ '1.50005', 1, 50005, 50005 ];
yield [ '2.1', 2, 1, 1 ];
yield [ '1,2', '1', 2, 9 ];
yield [ '1,02', '1', 2, 99 ];
yield [ '1,002', '1', 2, 100 ];
yield [ '1,50005', '1', 50005, 50005 ];
yield [ '2,1', '2', 1, 1 ];
yield [ '3.2,1', '3.2', 1, 1 ];
}
/**