2022-02-28 03:05:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Tests\User\TempUser;
|
|
|
|
|
|
|
|
|
|
use MediaWiki\User\TempUser\PlainNumericSerialMapping;
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\User\TempUser\PlainNumericSerialMapping
|
|
|
|
|
*/
|
|
|
|
|
class PlainNumericSerialMappingTest extends TestCase {
|
|
|
|
|
public function testGetSerialIdForIndex() {
|
|
|
|
|
$map = new PlainNumericSerialMapping( [] );
|
|
|
|
|
$this->assertSame( '111', $map->getSerialIdForIndex( 111 ) );
|
|
|
|
|
}
|
2023-12-15 18:29:51 +00:00
|
|
|
|
|
|
|
|
public function testGetSerialIdForIndexWithOffset() {
|
|
|
|
|
$map = new PlainNumericSerialMapping( [ 'offset' => 111 ] );
|
|
|
|
|
$this->assertSame( '222', $map->getSerialIdForIndex( 111 ) );
|
|
|
|
|
}
|
2022-02-28 03:05:58 +00:00
|
|
|
}
|