Go to the documentation of this file.
9 protected function setUp() {
10 global $wgDefaultUserOptions;
13 $wgDefaultUserOptions[
'gender'] =
'unknown';
18 if (
$user->getID() == 0 ) {
19 $user->addToDatabase();
20 $user->setPassword(
'UTMalePassword' );
23 $user->setOption(
'gender',
'male' );
24 $user->saveSettings();
27 if (
$user->getID() == 0 ) {
28 $user->addToDatabase();
29 $user->setPassword(
'UTFemalePassword' );
32 $user->setOption(
'gender',
'female' );
33 $user->saveSettings();
36 if (
$user->getID() == 0 ) {
37 $user->addToDatabase();
38 $user->setPassword(
'UTDefaultGenderPassword' );
41 $user->setOption(
'gender',
null );
42 $user->saveSettings();
53 $gender = $genderCache->getGenderOf( $username );
54 $this->assertEquals( $gender, $expectedGender,
"GenderCache normal" );
66 $gender = $genderCache->getGenderOf(
$user );
67 $this->assertEquals( $gender, $expectedGender,
"GenderCache normal" );
72 array(
'UTMale',
'male' ),
73 array(
'UTFemale',
'female' ),
74 array(
'UTDefaultGender',
'unknown' ),
75 array(
'UTNotExist',
'unknown' ),
77 array(
'127.0.0.1',
'unknown' ),
78 array(
'user@test',
'unknown' ),
91 $gender = $genderCache->getGenderOf( $pageWithSubpage );
92 $this->assertEquals( $gender, $expectedGender,
"GenderCache must strip of subpages" );
97 array(
'UTMale/subpage',
'male' ),
98 array(
'UTFemale/subpage',
'female' ),
99 array(
'UTDefaultGender/subpage',
'unknown' ),
100 array(
'UTNotExist/subpage',
'unknown' ),
101 array(
'127.0.0.1/subpage',
'unknown' ),
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static provideStripSubpages()
@group Database @group Cache
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
testUserName( $username, $expectedGender)
test usernames
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
testStripSubpages( $pageWithSubpage, $expectedGender)
test strip of subpages to avoid unnecessary queries against the never existing username
static provideUserGenders()
testUserObjects( $username, $expectedGender)
genderCache should work with user objects, too
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user