From 2fcaf74be70a81df35e383d5c3f584e3df643c34 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 26 Mar 2019 19:50:28 +0100 Subject: [PATCH] Enable email in TemporaryPasswordPrimaryAuthenticationProviderTest Change-Id: I1bc01a3634d11c56292881be7e6477e37ac61d03 --- ...yPasswordPrimaryAuthenticationProviderTest.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php index 1da4ee0ade..80cfbe699e 100644 --- a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php @@ -191,7 +191,8 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC * @param array $expected */ public function testGetAuthenticationRequests( $action, $options, $expected ) { - $actual = $this->getProvider()->getAuthenticationRequests( $action, $options ); + $actual = $this->getProvider( [ 'emailEnabled' => true ] ) + ->getAuthenticationRequests( $action, $options ); foreach ( $actual as $req ) { if ( $req instanceof TemporaryPasswordAuthenticationRequest && $req->password !== null ) { $req->password = 'random'; @@ -521,11 +522,15 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC $status = $provider->providerAllowsAuthenticationDataChange( $req, true ); $this->assertEquals( \StatusValue::newFatal( 'passwordreset-emaildisabled' ), $status ); - $provider = $this->getProvider( [ 'passwordReminderResendTime' => 10 ] ); + $provider = $this->getProvider( [ + 'emailEnabled' => true, 'passwordReminderResendTime' => 10 + ] ); $status = $provider->providerAllowsAuthenticationDataChange( $req, true ); $this->assertEquals( \StatusValue::newFatal( 'throttled-mailpassword', 10 ), $status ); - $provider = $this->getProvider( [ 'passwordReminderResendTime' => 3 ] ); + $provider = $this->getProvider( [ + 'emailEnabled' => true, 'passwordReminderResendTime' => 3 + ] ); $status = $provider->providerAllowsAuthenticationDataChange( $req, true ); $this->assertFalse( $status->hasMessage( 'throttled-mailpassword' ) ); @@ -534,7 +539,9 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC [ 'user_newpass_time' => $dbw->timestamp( time() + 5 * 3600 ) ], [ 'user_id' => $user->getId() ] ); - $provider = $this->getProvider( [ 'passwordReminderResendTime' => 0 ] ); + $provider = $this->getProvider( [ + 'emailEnabled' => true, 'passwordReminderResendTime' => 0 + ] ); $status = $provider->providerAllowsAuthenticationDataChange( $req, true ); $this->assertFalse( $status->hasMessage( 'throttled-mailpassword' ) ); -- 2.20.1