12 [
'valid:>User1', Title::makeTitle(
NS_MAIN,
':User:User1',
'',
'valid' ) ],
15 Title::makeTitle(
NS_MAIN,
'valid::User:User1',
'',
'valid' )
19 Title::makeTitle(
NS_SPECIAL,
'Contributions/127.0.0.1',
'',
'' )
21 [
'invalid:>User1', null ]
30 $interwikiLookupMock = $this->getMockBuilder( InterwikiLookup::class )
33 $interwikiValueMap = [
37 $interwikiLookupMock->expects( $this->
any() )
38 ->method(
'isValidInterwiki' )
39 ->will( $this->returnValueMap( $interwikiValueMap ) );
41 $this->
setService(
'InterwikiLookup', $interwikiLookupMock );
51 [
'User1',
'prefix',
'prefix>User1' ],
52 [
'User1',
'prefix:>',
'prefix>User1' ],
53 [
'User1',
'prefix:',
'prefix>User1' ],
66 $externalUserNames->applyPrefix(
$username )
72 [
'User1',
'prefix',
'prefix>User1' ],
73 [
'User2',
'prefix2',
'prefix2>User2' ],
74 [
'User3',
'prefix3',
'prefix3>User3' ],
87 $externalUserNames->addPrefix(
$username )
95 [
'prefix>User1',
true ],
96 [
'prefix:>User1',
true ],
113 [
'User1',
'User1' ],
114 [
'>User2',
'User2' ],
115 [
'prefix>User3',
'User3' ],
116 [
'prefix:>User4',
'User4' ],
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
provideGetUserLinkTitle()
testGetUserLinkTitle( $username, $expected)
ExternalUserNames::getUserLinkTitle provideGetUserLinkTitle.
testGetLocal( $username, $expected)
ExternalUserNames::getLocal provideGetLocal.
testApplyPrefix( $username, $prefix, $expected)
ExternalUserNames::applyPrefix provideApplyPrefix.
testIsExternal( $username, $expected)
ExternalUserNames::isExternal provideIsExternal.
testAddPrefix( $username, $prefix, $expected)
ExternalUserNames::addPrefix provideAddPrefix.
Class to parse and build external user names.
static getUserLinkTitle( $userName)
Get a target Title to link a username.
static isExternal( $username)
Tells whether the username is external or not.
static getLocal( $username)
Get local part of the user name.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
this hook is for auditing only or null if authentication failed before getting that far $username
processing should stop and the error should be shown to the user * false