3 namespace MediaWiki\Auth
;
7 * @covers MediaWiki\Auth\RememberMeAuthenticationRequest
9 class RememberMeAuthenticationRequestTest
extends AuthenticationRequestTestCase
{
11 public static function provideGetFieldInfo() {
18 public function testGetFieldInfo_2() {
19 $req = new RememberMeAuthenticationRequest();
20 $reqWrapper = \TestingAccessWrapper
::newFromObject( $req );
22 $reqWrapper->expiration
= 30 * 24 * 3600;
23 $this->assertNotEmpty( $req->getFieldInfo() );
25 $reqWrapper->expiration
= null;
26 $this->assertEmpty( $req->getFieldInfo() );
29 protected function getInstance( array $args = [] ) {
30 $req = new RememberMeAuthenticationRequest();
31 $reqWrapper = \TestingAccessWrapper
::newFromObject( $req );
32 $reqWrapper->expiration
= $args[0];
36 public function provideLoadFromSubmission() {
41 [ 'expiration' => 30 * 24 * 3600, 'rememberMe' => false ]
43 'RememberMe present' => [
45 [ 'rememberMe' => '' ],
46 [ 'expiration' => 30 * 24 * 3600, 'rememberMe' => true ]
48 'RememberMe present but session provider cannot remember' => [
50 [ 'rememberMe' => '' ],