3 namespace MediaWiki\Auth
;
5 use Wikimedia\TestingAccessWrapper
;
9 * @covers MediaWiki\Auth\RememberMeAuthenticationRequest
11 class RememberMeAuthenticationRequestTest
extends AuthenticationRequestTestCase
{
13 public static function provideGetFieldInfo() {
20 public function testGetFieldInfo_2() {
21 $req = new RememberMeAuthenticationRequest();
22 $reqWrapper = TestingAccessWrapper
::newFromObject( $req );
24 $reqWrapper->expiration
= 30 * 24 * 3600;
25 $this->assertNotEmpty( $req->getFieldInfo() );
27 $reqWrapper->expiration
= null;
28 $this->assertEmpty( $req->getFieldInfo() );
31 protected function getInstance( array $args = [] ) {
32 $req = new RememberMeAuthenticationRequest();
33 $reqWrapper = TestingAccessWrapper
::newFromObject( $req );
34 $reqWrapper->expiration
= $args[0];
38 public function provideLoadFromSubmission() {
43 [ 'expiration' => 30 * 24 * 3600, 'rememberMe' => false ]
45 'RememberMe present' => [
47 [ 'rememberMe' => '' ],
48 [ 'expiration' => 30 * 24 * 3600, 'rememberMe' => true ]
50 'RememberMe present but session provider cannot remember' => [
52 [ 'rememberMe' => '' ],