Merge "Tweak fullscreen styles for API sandbox"
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / ResetPasswordSecondaryAuthenticationProviderTest.php
index 59edede..90ed542 100644 (file)
@@ -7,15 +7,6 @@ namespace MediaWiki\Auth;
  * @covers MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider
  */
 class ResetPasswordSecondaryAuthenticationProviderTest extends \MediaWikiTestCase {
-       protected function setUp() {
-               global $wgDisableAuthManager;
-
-               parent::setUp();
-               if ( $wgDisableAuthManager ) {
-                       $this->markTestSkipped( '$wgDisableAuthManager is set' );
-               }
-       }
-
        /**
         * @dataProvider provideGetAuthenticationRequests
         * @param string $action
@@ -216,7 +207,9 @@ class ResetPasswordSecondaryAuthenticationProviderTest extends \MediaWikiTestCas
                $this->assertSame( AuthenticationResponse::UI, $res->status );
                $this->assertEquals( $msg, $res->message );
                $this->assertCount( 2, $res->neededRequests );
-               $this->assertEquals( $passReq, $res->neededRequests[0] );
+               $expectedPassReq = clone $passReq;
+               $expectedPassReq->required = AuthenticationRequest::OPTIONAL;
+               $this->assertEquals( $expectedPassReq, $res->neededRequests[0] );
                $this->assertEquals( $skipReq, $res->neededRequests[1] );
                $this->assertNotNull( $manager->getAuthenticationSessionData( 'reset-pass' ) );
                $this->assertFalse( $passReq->done );
@@ -304,7 +297,9 @@ class ResetPasswordSecondaryAuthenticationProviderTest extends \MediaWikiTestCas
                $this->assertSame( AuthenticationResponse::UI, $res->status );
                $this->assertEquals( $msg, $res->message );
                $this->assertCount( 2, $res->neededRequests );
-               $this->assertEquals( $passReq2, $res->neededRequests[0] );
+               $expectedPassReq = clone $passReq2;
+               $expectedPassReq->required = AuthenticationRequest::OPTIONAL;
+               $this->assertEquals( $expectedPassReq, $res->neededRequests[0] );
                $this->assertEquals( $skipReq, $res->neededRequests[1] );
                $this->assertNotNull( $manager->getAuthenticationSessionData( 'reset-pass' ) );
                $this->assertFalse( $passReq->done );