X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FEmailNotificationSecondaryAuthenticationProviderTest.php;h=3757069e344dd87571793920c4e9bcf74c8b1c92;hb=d75a576e2606db6a719e99ca488aa700c1db487d;hp=ec4bea11a123d071524bebe192f0047dbbf6bb4f;hpb=52546163af81a588f3104d447657f24d071aa53f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php index ec4bea11a1..3757069e34 100644 --- a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php @@ -3,6 +3,7 @@ namespace MediaWiki\Auth; use Psr\Log\LoggerInterface; +use Wikimedia\TestingAccessWrapper; class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -13,14 +14,14 @@ class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit_Fram $provider = new EmailNotificationSecondaryAuthenticationProvider(); $provider->setConfig( $config ); - $providerPriv = \TestingAccessWrapper::newFromObject( $provider ); + $providerPriv = TestingAccessWrapper::newFromObject( $provider ); $this->assertTrue( $providerPriv->sendConfirmationEmail ); $provider = new EmailNotificationSecondaryAuthenticationProvider( [ 'sendConfirmationEmail' => false, ] ); $provider->setConfig( $config ); - $providerPriv = \TestingAccessWrapper::newFromObject( $provider ); + $providerPriv = TestingAccessWrapper::newFromObject( $provider ); $this->assertFalse( $providerPriv->sendConfirmationEmail ); } @@ -57,24 +58,24 @@ class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit_Fram public function testBeginSecondaryAccountCreation() { $authManager = new AuthManager( new \FauxRequest(), new \HashConfig() ); - $creator = $this->getMock( 'User' ); - $userWithoutEmail = $this->getMock( 'User' ); + $creator = $this->getMockBuilder( 'User' )->getMock(); + $userWithoutEmail = $this->getMockBuilder( 'User' )->getMock(); $userWithoutEmail->expects( $this->any() )->method( 'getEmail' )->willReturn( '' ); $userWithoutEmail->expects( $this->any() )->method( 'getInstanceForUpdate' )->willReturnSelf(); $userWithoutEmail->expects( $this->never() )->method( 'sendConfirmationMail' ); - $userWithEmailError = $this->getMock( 'User' ); + $userWithEmailError = $this->getMockBuilder( 'User' )->getMock(); $userWithEmailError->expects( $this->any() )->method( 'getEmail' )->willReturn( 'foo@bar.baz' ); $userWithEmailError->expects( $this->any() )->method( 'getInstanceForUpdate' )->willReturnSelf(); $userWithEmailError->expects( $this->any() )->method( 'sendConfirmationMail' ) ->willReturn( \Status::newFatal( 'fail' ) ); - $userExpectsConfirmation = $this->getMock( 'User' ); + $userExpectsConfirmation = $this->getMockBuilder( 'User' )->getMock(); $userExpectsConfirmation->expects( $this->any() )->method( 'getEmail' ) ->willReturn( 'foo@bar.baz' ); $userExpectsConfirmation->expects( $this->any() )->method( 'getInstanceForUpdate' ) ->willReturnSelf(); $userExpectsConfirmation->expects( $this->once() )->method( 'sendConfirmationMail' ) ->willReturn( \Status::newGood() ); - $userNotExpectsConfirmation = $this->getMock( 'User' ); + $userNotExpectsConfirmation = $this->getMockBuilder( 'User' )->getMock(); $userNotExpectsConfirmation->expects( $this->any() )->method( 'getEmail' ) ->willReturn( 'foo@bar.baz' ); $userNotExpectsConfirmation->expects( $this->any() )->method( 'getInstanceForUpdate' )