11 $user = \User::newFromName(
'UTSysop' );
16 $provider->continuePrimaryAuthentication( [] );
17 $this->fail(
'Expected exception not thrown' );
18 }
catch ( \BadMethodCallException $ex ) {
22 $provider->continuePrimaryAccountCreation( $user, $user, [] );
23 $this->fail(
'Expected exception not thrown' );
24 }
catch ( \BadMethodCallException $ex ) {
29 $this->
assertTrue( $provider->providerAllowsPropertyChange(
'foo' ) );
31 \StatusValue::newGood(),
32 $provider->testForAccountCreation( $user, $user, [] )
35 \StatusValue::newGood(),
39 \StatusValue::newGood(),
40 $provider->testUserForCreation( $user,
false )
49 $provider->postAuthentication( $user,
$res );
50 $provider->postAccountCreation( $user, $user,
$res );
51 $provider->postAccountLink( $user,
$res );
53 $provider->expects( $this->
once() )
54 ->method(
'testUserExists' )
55 ->with( $this->
equalTo(
'foo' ) )
57 $this->
assertTrue( $provider->testUserCanAuthenticate(
'foo' ) );
95 $provider->expects( $this->
any() )->method(
'accountCreationType' )
98 $class = AbstractPrimaryAuthenticationProvider::class;
99 $msg1 =
"{$class}::beginPrimaryAccountLink $msg";
100 $msg2 =
"{$class}::continuePrimaryAccountLink is not implemented.";
102 $user = \User::newFromName(
'Whatever' );
105 $provider->beginPrimaryAccountLink( $user, [] );
106 $this->fail(
'Expected exception not thrown' );
107 }
catch ( \BadMethodCallException $ex ) {
108 $this->
assertSame( $msg1, $ex->getMessage() );
111 $provider->continuePrimaryAccountLink( $user, [] );
112 $this->fail(
'Expected exception not thrown' );
113 }
catch ( \BadMethodCallException $ex ) {
114 $this->
assertSame( $msg2, $ex->getMessage() );