X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fuser%2FExternalUserNamesTest.php;h=429bda46259ac68bebe167630e071a2fe3b26db8;hp=cf395f24270d0d65f536b0371a9af71dfef6b0d9;hb=17e8f7d62ec6d660c1f073efdaa0cbda68d59ae3;hpb=d9b7592d5e7b31c93b0d71852bd692682f73788b diff --git a/tests/phpunit/includes/user/ExternalUserNamesTest.php b/tests/phpunit/includes/user/ExternalUserNamesTest.php index cf395f2427..429bda4625 100644 --- a/tests/phpunit/includes/user/ExternalUserNamesTest.php +++ b/tests/phpunit/includes/user/ExternalUserNamesTest.php @@ -108,4 +108,24 @@ class ExternalUserNamesTest extends MediaWikiTestCase { ); } + public function provideGetLocal() { + return [ + [ 'User1', 'User1' ], + [ '>User2', 'User2' ], + [ 'prefix>User3', 'User3' ], + [ 'prefix:>User4', 'User4' ], + ]; + } + + /** + * @covers ExternalUserNames::getLocal + * @dataProvider provideGetLocal + */ + public function testGetLocal( $username, $expected ) { + $this->assertSame( + $expected, + ExternalUserNames::getLocal( $username ) + ); + } + }