11 $user = \User::newFromName(
'UTSysop' );
16 $provider->continueSecondaryAuthentication( $user, [] );
17 $this->fail(
'Expected exception not thrown' );
18 }
catch ( \BadMethodCallException $ex ) {
22 $provider->continueSecondaryAccountCreation( $user, $user, [] );
23 $this->fail(
'Expected exception not thrown' );
24 }
catch ( \BadMethodCallException $ex ) {
29 $this->
assertTrue( $provider->providerAllowsPropertyChange(
'foo' ) );
31 \StatusValue::newGood(
'ignored' ),
32 $provider->providerAllowsAuthenticationDataChange(
$req )
35 \StatusValue::newGood(),
36 $provider->testForAccountCreation( $user, $user, [] )
39 \StatusValue::newGood(),
43 \StatusValue::newGood(),
44 $provider->testUserForCreation( $user,
false )
47 $provider->providerChangeAuthenticationData(
$req );
51 $provider->postAuthentication( $user,
$res );
52 $provider->postAccountCreation( $user, $user,
$res );
57 for ( $i = 0; $i < 3; $i++ ) {
58 $reqs[
$i] = $this->
createMock( AuthenticationRequest::class );
59 $reqs[
$i]->done =
false;
62 $provider = $this->
getMockBuilder( AbstractSecondaryAuthenticationProvider::class )
63 ->setMethods( [
'providerChangeAuthenticationData' ] )
64 ->getMockForAbstractClass();
65 $provider->expects( $this->
once() )->method(
'getAuthenticationRequests' )
71 $provider->expects( $this->
exactly( 3 ) )->method(
'providerChangeAuthenticationData' )
78 $provider->providerRevokeAccessForUser(
'UTSysop' );
80 foreach ( $reqs as $i =>
$req ) {