mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
Merge "Remove not needed int type from ReferenceListFormatter"
This commit is contained in:
commit
9fb20ec09a
|
@ -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 {
|
||||
|
|
|
@ -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 ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue