mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-21 11:02:51 +00:00
411ee7efad
Changes to the use statements done automatically via script Change-Id: I0768f296b528c81edd6bd9ac7d76515b15f3da6f
29 lines
1,003 B
PHP
29 lines
1,003 B
PHP
<?php
|
|
|
|
namespace Cite\Tests\Unit;
|
|
|
|
use Cite\ReferenceMessageLocalizer;
|
|
use MediaWiki\Language\Language;
|
|
|
|
/**
|
|
* @covers \Cite\ReferenceMessageLocalizer
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class ReferenceMessageLocalizerUnitTest extends \MediaWikiUnitTestCase {
|
|
|
|
public function testLocalizeSeparators() {
|
|
$mockLanguage = $this->createNoOpMock( Language::class, [ 'separatorTransformTable' ] );
|
|
$mockLanguage->method( 'separatorTransformTable' )->willReturn( [ '.' => ',', '0' => '' ] );
|
|
$messageLocalizer = new ReferenceMessageLocalizer( $mockLanguage );
|
|
$this->assertSame( '10,0', $messageLocalizer->localizeSeparators( '10.0' ) );
|
|
}
|
|
|
|
public function testLocalizeDigits() {
|
|
$mockLanguage = $this->createNoOpMock( Language::class, [ 'formatNumNoSeparators' ] );
|
|
$mockLanguage->method( 'formatNumNoSeparators' )->willReturnArgument( 0 );
|
|
$messageLocalizer = new ReferenceMessageLocalizer( $mockLanguage );
|
|
$this->assertSame( '50005', $messageLocalizer->localizeDigits( '50005' ) );
|
|
}
|
|
|
|
}
|