MediaWiki  1.28.0
LocalPasswordPrimaryAuthenticationProviderTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Auth;
4 
11 
12  private $manager = null;
13  private $config = null;
14  private $validity = null;
15 
25  protected function getProvider( $loginOnly = false ) {
26  if ( !$this->config ) {
27  $this->config = new \HashConfig();
28  }
29  $config = new \MultiConfig( [
30  $this->config,
31  \ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
32  ] );
33 
34  if ( !$this->manager ) {
35  $this->manager = new AuthManager( new \FauxRequest(), $config );
36  }
37  $this->validity = \Status::newGood();
38 
39  $provider = $this->getMock(
41  [ 'checkPasswordValidity' ],
42  [ [ 'loginOnly' => $loginOnly ] ]
43  );
44  $provider->expects( $this->any() )->method( 'checkPasswordValidity' )
45  ->will( $this->returnCallback( function () {
46  return $this->validity;
47  } ) );
48  $provider->setConfig( $config );
49  $provider->setLogger( new \Psr\Log\NullLogger() );
50  $provider->setManager( $this->manager );
51 
52  return $provider;
53  }
54 
55  public function testBasics() {
56  $user = $this->getMutableTestUser()->getUser();
57  $userName = $user->getName();
58  $lowerInitialUserName = mb_strtolower( $userName[0] ) . substr( $userName, 1 );
59 
61 
62  $this->assertSame(
64  $provider->accountCreationType()
65  );
66 
67  $this->assertTrue( $provider->testUserExists( $userName ) );
68  $this->assertTrue( $provider->testUserExists( $lowerInitialUserName ) );
69  $this->assertFalse( $provider->testUserExists( 'DoesNotExist' ) );
70  $this->assertFalse( $provider->testUserExists( '<invalid>' ) );
71 
72  $provider = new LocalPasswordPrimaryAuthenticationProvider( [ 'loginOnly' => true ] );
73 
74  $this->assertSame(
76  $provider->accountCreationType()
77  );
78 
79  $this->assertTrue( $provider->testUserExists( $userName ) );
80  $this->assertFalse( $provider->testUserExists( 'DoesNotExist' ) );
81 
83  $req->action = AuthManager::ACTION_CHANGE;
84  $req->username = '<invalid>';
85  $provider->providerChangeAuthenticationData( $req );
86  }
87 
88  public function testTestUserCanAuthenticate() {
89  $user = $this->getMutableTestUser()->getUser();
90  $userName = $user->getName();
91  $dbw = wfGetDB( DB_MASTER );
92 
93  $provider = $this->getProvider();
94 
95  $this->assertFalse( $provider->testUserCanAuthenticate( '<invalid>' ) );
96 
97  $this->assertFalse( $provider->testUserCanAuthenticate( 'DoesNotExist' ) );
98 
99  $this->assertTrue( $provider->testUserCanAuthenticate( $userName ) );
100  $lowerInitialUserName = mb_strtolower( $userName[0] ) . substr( $userName, 1 );
101  $this->assertTrue( $provider->testUserCanAuthenticate( $lowerInitialUserName ) );
102 
103  $dbw->update(
104  'user',
105  [ 'user_password' => \PasswordFactory::newInvalidPassword()->toString() ],
106  [ 'user_name' => $userName ]
107  );
108  $this->assertFalse( $provider->testUserCanAuthenticate( $userName ) );
109 
110  // Really old format
111  $dbw->update(
112  'user',
113  [ 'user_password' => '0123456789abcdef0123456789abcdef' ],
114  [ 'user_name' => $userName ]
115  );
116  $this->assertTrue( $provider->testUserCanAuthenticate( $userName ) );
117  }
118 
119  public function testSetPasswordResetFlag() {
120  // Set instance vars
121  $this->getProvider();
122 
124  $this->setMwGlobals( [ 'wgPasswordExpireGrace' => 100 ] );
125 
126  $this->config->set( 'PasswordExpireGrace', 100 );
127  $this->config->set( 'InvalidPasswordReset', true );
128 
130  $provider->setConfig( $this->config );
131  $provider->setLogger( new \Psr\Log\NullLogger() );
132  $provider->setManager( $this->manager );
133  $providerPriv = \TestingAccessWrapper::newFromObject( $provider );
134 
135  $user = $this->getMutableTestUser()->getUser();
136  $userName = $user->getName();
137  $dbw = wfGetDB( DB_MASTER );
138  $row = $dbw->selectRow(
139  'user',
140  '*',
141  [ 'user_name' => $userName ],
142  __METHOD__
143  );
144 
145  $this->manager->removeAuthenticationSessionData( null );
146  $row->user_password_expires = wfTimestamp( TS_MW, time() + 200 );
147  $providerPriv->setPasswordResetFlag( $userName, \Status::newGood(), $row );
148  $this->assertNull( $this->manager->getAuthenticationSessionData( 'reset-pass' ) );
149 
150  $this->manager->removeAuthenticationSessionData( null );
151  $row->user_password_expires = wfTimestamp( TS_MW, time() - 200 );
152  $providerPriv->setPasswordResetFlag( $userName, \Status::newGood(), $row );
153  $ret = $this->manager->getAuthenticationSessionData( 'reset-pass' );
154  $this->assertNotNull( $ret );
155  $this->assertSame( 'resetpass-expired', $ret->msg->getKey() );
156  $this->assertTrue( $ret->hard );
157 
158  $this->manager->removeAuthenticationSessionData( null );
159  $row->user_password_expires = wfTimestamp( TS_MW, time() - 1 );
160  $providerPriv->setPasswordResetFlag( $userName, \Status::newGood(), $row );
161  $ret = $this->manager->getAuthenticationSessionData( 'reset-pass' );
162  $this->assertNotNull( $ret );
163  $this->assertSame( 'resetpass-expired-soft', $ret->msg->getKey() );
164  $this->assertFalse( $ret->hard );
165 
166  $this->manager->removeAuthenticationSessionData( null );
167  $row->user_password_expires = null;
169  $status->error( 'testing' );
170  $providerPriv->setPasswordResetFlag( $userName, $status, $row );
171  $ret = $this->manager->getAuthenticationSessionData( 'reset-pass' );
172  $this->assertNotNull( $ret );
173  $this->assertSame( 'resetpass-validity-soft', $ret->msg->getKey() );
174  $this->assertFalse( $ret->hard );
175  }
176 
177  public function testAuthentication() {
178  $testUser = $this->getMutableTestUser();
179  $userName = $testUser->getUser()->getName();
180 
181  $dbw = wfGetDB( DB_MASTER );
182  $id = \User::idFromName( $userName );
183 
187 
188  $provider = $this->getProvider();
189 
190  // General failures
191  $this->assertEquals(
193  $provider->beginPrimaryAuthentication( [] )
194  );
195 
196  $req->username = 'foo';
197  $req->password = null;
198  $this->assertEquals(
200  $provider->beginPrimaryAuthentication( $reqs )
201  );
202 
203  $req->username = null;
204  $req->password = 'bar';
205  $this->assertEquals(
207  $provider->beginPrimaryAuthentication( $reqs )
208  );
209 
210  $req->username = '<invalid>';
211  $req->password = 'WhoCares';
212  $ret = $provider->beginPrimaryAuthentication( $reqs );
213  $this->assertEquals(
215  $provider->beginPrimaryAuthentication( $reqs )
216  );
217 
218  $req->username = 'DoesNotExist';
219  $req->password = 'DoesNotExist';
220  $ret = $provider->beginPrimaryAuthentication( $reqs );
221  $this->assertEquals(
223  $provider->beginPrimaryAuthentication( $reqs )
224  );
225 
226  // Validation failure
227  $req->username = $userName;
228  $req->password = $testUser->getPassword();
229  $this->validity = \Status::newFatal( 'arbitrary-failure' );
230  $ret = $provider->beginPrimaryAuthentication( $reqs );
231  $this->assertEquals(
233  $ret->status
234  );
235  $this->assertEquals(
236  'arbitrary-failure',
237  $ret->message->getKey()
238  );
239 
240  // Successful auth
241  $this->manager->removeAuthenticationSessionData( null );
242  $this->validity = \Status::newGood();
243  $this->assertEquals(
244  AuthenticationResponse::newPass( $userName ),
245  $provider->beginPrimaryAuthentication( $reqs )
246  );
247  $this->assertNull( $this->manager->getAuthenticationSessionData( 'reset-pass' ) );
248 
249  // Successful auth after normalizing name
250  $this->manager->removeAuthenticationSessionData( null );
251  $this->validity = \Status::newGood();
252  $req->username = mb_strtolower( $userName[0] ) . substr( $userName, 1 );
253  $this->assertEquals(
254  AuthenticationResponse::newPass( $userName ),
255  $provider->beginPrimaryAuthentication( $reqs )
256  );
257  $this->assertNull( $this->manager->getAuthenticationSessionData( 'reset-pass' ) );
258  $req->username = $userName;
259 
260  // Successful auth with reset
261  $this->manager->removeAuthenticationSessionData( null );
262  $this->validity->error( 'arbitrary-warning' );
263  $this->assertEquals(
264  AuthenticationResponse::newPass( $userName ),
265  $provider->beginPrimaryAuthentication( $reqs )
266  );
267  $this->assertNotNull( $this->manager->getAuthenticationSessionData( 'reset-pass' ) );
268 
269  // Wrong password
270  $this->validity = \Status::newGood();
271  $req->password = 'Wrong';
272  $ret = $provider->beginPrimaryAuthentication( $reqs );
273  $this->assertEquals(
275  $ret->status
276  );
277  $this->assertEquals(
278  'wrongpassword',
279  $ret->message->getKey()
280  );
281 
282  // Correct handling of legacy encodings
283  $password = ':B:salt:' . md5( 'salt-' . md5( "\xe1\xe9\xed\xf3\xfa" ) );
284  $dbw->update( 'user', [ 'user_password' => $password ], [ 'user_name' => $userName ] );
285  $req->password = 'áéíóú';
286  $ret = $provider->beginPrimaryAuthentication( $reqs );
287  $this->assertEquals(
289  $ret->status
290  );
291  $this->assertEquals(
292  'wrongpassword',
293  $ret->message->getKey()
294  );
295 
296  $this->config->set( 'LegacyEncoding', true );
297  $this->assertEquals(
298  AuthenticationResponse::newPass( $userName ),
299  $provider->beginPrimaryAuthentication( $reqs )
300  );
301 
302  $req->password = 'áéíóú Wrong';
303  $ret = $provider->beginPrimaryAuthentication( $reqs );
304  $this->assertEquals(
306  $ret->status
307  );
308  $this->assertEquals(
309  'wrongpassword',
310  $ret->message->getKey()
311  );
312 
313  // Correct handling of really old password hashes
314  $this->config->set( 'PasswordSalt', false );
315  $password = md5( 'FooBar' );
316  $dbw->update( 'user', [ 'user_password' => $password ], [ 'user_name' => $userName ] );
317  $req->password = 'FooBar';
318  $this->assertEquals(
319  AuthenticationResponse::newPass( $userName ),
320  $provider->beginPrimaryAuthentication( $reqs )
321  );
322 
323  $this->config->set( 'PasswordSalt', true );
324  $password = md5( "$id-" . md5( 'FooBar' ) );
325  $dbw->update( 'user', [ 'user_password' => $password ], [ 'user_name' => $userName ] );
326  $req->password = 'FooBar';
327  $this->assertEquals(
328  AuthenticationResponse::newPass( $userName ),
329  $provider->beginPrimaryAuthentication( $reqs )
330  );
331 
332  }
333 
343  \StatusValue $expect1, \StatusValue $expect2
344  ) {
346  $req = new $type();
348  $req = new $type( [] );
349  } else {
350  $req = $this->getMock( $type );
351  }
353  $req->username = $user;
354  $req->password = 'NewPassword';
355  $req->retype = 'NewPassword';
356 
357  $provider = $this->getProvider();
358  $this->validity = $validity;
359  $this->assertEquals( $expect1, $provider->providerAllowsAuthenticationDataChange( $req, false ) );
360  $this->assertEquals( $expect2, $provider->providerAllowsAuthenticationDataChange( $req, true ) );
361 
362  $req->retype = 'BadRetype';
363  $this->assertEquals(
364  $expect1,
365  $provider->providerAllowsAuthenticationDataChange( $req, false )
366  );
367  $this->assertEquals(
368  $expect2->getValue() === 'ignored' ? $expect2 : \StatusValue::newFatal( 'badretype' ),
369  $provider->providerAllowsAuthenticationDataChange( $req, true )
370  );
371 
372  $provider = $this->getProvider( true );
373  $this->assertEquals(
374  \StatusValue::newGood( 'ignored' ),
375  $provider->providerAllowsAuthenticationDataChange( $req, true ),
376  'loginOnly mode should claim to ignore all changes'
377  );
378  }
379 
381  $err = \StatusValue::newGood();
382  $err->error( 'arbitrary-warning' );
383 
384  return [
386  \StatusValue::newGood( 'ignored' ), \StatusValue::newGood( 'ignored' ) ],
392  \StatusValue::newGood(), $err ],
393  [ PasswordAuthenticationRequest::class, 'UTSysop', \Status::newFatal( 'arbitrary-error' ),
394  \StatusValue::newGood(), \StatusValue::newFatal( 'arbitrary-error' ) ],
398  \StatusValue::newGood( 'ignored' ), \StatusValue::newGood( 'ignored' ) ],
399  ];
400  }
401 
410  $usernameTransform, $type, $loginOnly, $changed ) {
411  $testUser = $this->getMutableTestUser();
412  $user = $testUser->getUser()->getName();
413  if ( is_callable( $usernameTransform ) ) {
414  $user = call_user_func( $usernameTransform, $user );
415  }
416  $cuser = ucfirst( $user );
417  $oldpass = $testUser->getPassword();
418  $newpass = 'NewPassword';
419 
420  $dbw = wfGetDB( DB_MASTER );
421  $oldExpiry = $dbw->selectField( 'user', 'user_password_expires', [ 'user_name' => $cuser ] );
422 
423  $this->mergeMwGlobalArrayValue( 'wgHooks', [
424  'ResetPasswordExpiration' => [ function ( $user, &$expires ) {
425  $expires = '30001231235959';
426  } ]
427  ] );
428 
429  $provider = $this->getProvider( $loginOnly );
430 
431  // Sanity check
432  $loginReq = new PasswordAuthenticationRequest();
433  $loginReq->action = AuthManager::ACTION_LOGIN;
434  $loginReq->username = $user;
435  $loginReq->password = $oldpass;
436  $loginReqs = [ PasswordAuthenticationRequest::class => $loginReq ];
437  $this->assertEquals(
439  $provider->beginPrimaryAuthentication( $loginReqs ),
440  'Sanity check'
441  );
442 
444  $changeReq = new $type();
445  } else {
446  $changeReq = $this->getMock( $type );
447  }
448  $changeReq->action = AuthManager::ACTION_CHANGE;
449  $changeReq->username = $user;
450  $changeReq->password = $newpass;
451  $provider->providerChangeAuthenticationData( $changeReq );
452 
453  if ( $loginOnly ) {
454  $old = 'fail';
455  $new = 'fail';
456  $expectExpiry = null;
457  } elseif ( $changed ) {
458  $old = 'fail';
459  $new = 'pass';
460  $expectExpiry = '30001231235959';
461  } else {
462  $old = 'pass';
463  $new = 'fail';
464  $expectExpiry = $oldExpiry;
465  }
466 
467  $loginReq->password = $oldpass;
468  $ret = $provider->beginPrimaryAuthentication( $loginReqs );
469  if ( $old === 'pass' ) {
470  $this->assertEquals(
472  $ret,
473  'old password should pass'
474  );
475  } else {
476  $this->assertEquals(
478  $ret->status,
479  'old password should fail'
480  );
481  $this->assertEquals(
482  'wrongpassword',
483  $ret->message->getKey(),
484  'old password should fail'
485  );
486  }
487 
488  $loginReq->password = $newpass;
489  $ret = $provider->beginPrimaryAuthentication( $loginReqs );
490  if ( $new === 'pass' ) {
491  $this->assertEquals(
493  $ret,
494  'new password should pass'
495  );
496  } else {
497  $this->assertEquals(
499  $ret->status,
500  'new password should fail'
501  );
502  $this->assertEquals(
503  'wrongpassword',
504  $ret->message->getKey(),
505  'new password should fail'
506  );
507  }
508 
509  $this->assertSame(
510  $expectExpiry,
511  $dbw->selectField( 'user', 'user_password_expires', [ 'user_name' => $cuser ] )
512  );
513  }
514 
515  public static function provideProviderChangeAuthenticationData() {
516  return [
517  [ false, AuthenticationRequest::class, false, false ],
518  [ false, PasswordAuthenticationRequest::class, false, true ],
519  [ false, AuthenticationRequest::class, true, false ],
520  [ false, PasswordAuthenticationRequest::class, true, true ],
521  [ 'ucfirst', PasswordAuthenticationRequest::class, false, true ],
522  [ 'ucfirst', PasswordAuthenticationRequest::class, true, true ],
523  ];
524  }
525 
526  public function testTestForAccountCreation() {
527  $user = \User::newFromName( 'foo' );
530  $req->username = 'Foo';
531  $req->password = 'Bar';
532  $req->retype = 'Bar';
534 
535  $provider = $this->getProvider();
536  $this->assertEquals(
538  $provider->testForAccountCreation( $user, $user, [] ),
539  'No password request'
540  );
541 
542  $this->assertEquals(
544  $provider->testForAccountCreation( $user, $user, $reqs ),
545  'Password request, validated'
546  );
547 
548  $req->retype = 'Baz';
549  $this->assertEquals(
550  \StatusValue::newFatal( 'badretype' ),
551  $provider->testForAccountCreation( $user, $user, $reqs ),
552  'Password request, bad retype'
553  );
554  $req->retype = 'Bar';
555 
556  $this->validity->error( 'arbitrary warning' );
557  $expect = \StatusValue::newGood();
558  $expect->error( 'arbitrary warning' );
559  $this->assertEquals(
560  $expect,
561  $provider->testForAccountCreation( $user, $user, $reqs ),
562  'Password request, not validated'
563  );
564 
565  $provider = $this->getProvider( true );
566  $this->validity->error( 'arbitrary warning' );
567  $this->assertEquals(
569  $provider->testForAccountCreation( $user, $user, $reqs ),
570  'Password request, not validated, loginOnly'
571  );
572  }
573 
574  public function testAccountCreation() {
575  $user = \User::newFromName( 'Foo' );
576 
580 
581  $provider = $this->getProvider( true );
582  try {
583  $provider->beginPrimaryAccountCreation( $user, $user, [] );
584  $this->fail( 'Expected exception was not thrown' );
585  } catch ( \BadMethodCallException $ex ) {
586  $this->assertSame(
587  'Shouldn\'t call this when accountCreationType() is NONE', $ex->getMessage()
588  );
589  }
590 
591  try {
592  $provider->finishAccountCreation( $user, $user, AuthenticationResponse::newPass() );
593  $this->fail( 'Expected exception was not thrown' );
594  } catch ( \BadMethodCallException $ex ) {
595  $this->assertSame(
596  'Shouldn\'t call this when accountCreationType() is NONE', $ex->getMessage()
597  );
598  }
599 
600  $provider = $this->getProvider( false );
601 
602  $this->assertEquals(
604  $provider->beginPrimaryAccountCreation( $user, $user, [] )
605  );
606 
607  $req->username = 'foo';
608  $req->password = null;
609  $this->assertEquals(
611  $provider->beginPrimaryAccountCreation( $user, $user, $reqs )
612  );
613 
614  $req->username = null;
615  $req->password = 'bar';
616  $this->assertEquals(
618  $provider->beginPrimaryAccountCreation( $user, $user, $reqs )
619  );
620 
621  $req->username = 'foo';
622  $req->password = 'bar';
623 
624  $expect = AuthenticationResponse::newPass( 'Foo' );
625  $expect->createRequest = clone( $req );
626  $expect->createRequest->username = 'Foo';
627  $this->assertEquals( $expect, $provider->beginPrimaryAccountCreation( $user, $user, $reqs ) );
628 
629  // We have to cheat a bit to avoid having to add a new user to
630  // the database to test the actual setting of the password works right
631  $dbw = wfGetDB( DB_MASTER );
632 
633  $user = \User::newFromName( 'UTSysop' );
634  $req->username = $user->getName();
635  $req->password = 'NewPassword';
636  $expect = AuthenticationResponse::newPass( 'UTSysop' );
637  $expect->createRequest = $req;
638 
639  $res2 = $provider->beginPrimaryAccountCreation( $user, $user, $reqs );
640  $this->assertEquals( $expect, $res2, 'Sanity check' );
641 
642  $ret = $provider->beginPrimaryAuthentication( $reqs );
643  $this->assertEquals( AuthenticationResponse::FAIL, $ret->status, 'sanity check' );
644 
645  $this->assertNull( $provider->finishAccountCreation( $user, $user, $res2 ) );
646  $ret = $provider->beginPrimaryAuthentication( $reqs );
647  $this->assertEquals( AuthenticationResponse::PASS, $ret->status, 'new password is set' );
648 
649  }
650 
651 }
static newFromName($name, $validate= 'valid')
Static factory method for creation from username.
Definition: User.php:525
mergeMwGlobalArrayValue($name, $values)
Merges the given values into a MW global array variable.
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
static wrap($sv)
Succinct helper method to wrap a StatusValue.
Definition: Status.php:55
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:189
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 & $ret
Definition: hooks.txt:1936
static newFatal($message)
Factory function for fatal errors.
Definition: StatusValue.php:63
A primary authentication provider that uses the password field in the 'user' table.
const DB_MASTER
Definition: defines.php:23
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
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
Definition: hooks.txt:1936
const FAIL
Indicates that the authentication failed.
const ACTION_CHANGE
Change a user's credentials.
Definition: AuthManager.php:98
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
Definition: defines.php:11
const PASS
Indicates that the authentication succeeded.
testProviderChangeAuthenticationData($usernameTransform, $type, $loginOnly, $changed)
provideProviderChangeAuthenticationData
static newGood($value=null)
Factory function for good results.
Definition: StatusValue.php:76
This serves as the entry point to the authentication system.
Definition: AuthManager.php:81
const TYPE_NONE
Provider cannot create or link to accounts.
static newInvalidPassword()
Create an InvalidPassword.
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 local account $user
Definition: hooks.txt:242
This is a value object for authentication requests with a username and password.
static getDefaultInstance()
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
this hook is for auditing only $req
Definition: hooks.txt:1007
AuthManager Database MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
static idFromName($name, $flags=self::READ_NORMAL)
Get database id given a user name.
Definition: User.php:728
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
Definition: hooks.txt:1046
static getMutableTestUser($groups=[])
Convenience method for getting a mutable test user.
const ACTION_CREATE
Create a new user.
Definition: AuthManager.php:88
static newFromObject($object)
Return the same object, without access restrictions.
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition: AuthManager.php:83
setMwGlobals($pairs, $value=null)
testProviderAllowsAuthenticationDataChange($type, $user,\Status $validity,\StatusValue $expect1,\StatusValue $expect2)
provideProviderAllowsAuthenticationDataChange
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition: hooks.txt:2491