@@ -79,7 +79,7 @@ public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
79
79
80
80
public function testAuthenticateWhenPreChecksFails ()
81
81
{
82
- $ this ->expectException (' Symfony\Component\Security\Core\Exception\CredentialsExpiredException ' );
82
+ $ this ->expectException (BadCredentialsException::class );
83
83
$ userChecker = $ this ->getMockBuilder ('Symfony\Component\Security\Core\User\UserCheckerInterface ' )->getMock ();
84
84
$ userChecker ->expects ($ this ->once ())
85
85
->method ('checkPreAuth ' )
@@ -97,7 +97,7 @@ public function testAuthenticateWhenPreChecksFails()
97
97
98
98
public function testAuthenticateWhenPostChecksFails ()
99
99
{
100
- $ this ->expectException (' Symfony\Component\Security\Core\Exception\AccountExpiredException ' );
100
+ $ this ->expectException (BadCredentialsException::class );
101
101
$ userChecker = $ this ->getMockBuilder ('Symfony\Component\Security\Core\User\UserCheckerInterface ' )->getMock ();
102
102
$ userChecker ->expects ($ this ->once ())
103
103
->method ('checkPostAuth ' )
@@ -116,15 +116,15 @@ public function testAuthenticateWhenPostChecksFails()
116
116
public function testAuthenticateWhenPostCheckAuthenticationFails ()
117
117
{
118
118
$ this ->expectException ('Symfony\Component\Security\Core\Exception\BadCredentialsException ' );
119
- $ this ->expectExceptionMessage ('Bad credentials ' );
119
+ $ this ->expectExceptionMessage ('Bad credentials. ' );
120
120
$ provider = $ this ->getProvider ();
121
121
$ provider ->expects ($ this ->once ())
122
122
->method ('retrieveUser ' )
123
123
->willReturn ($ this ->getMockBuilder ('Symfony\Component\Security\Core\User\UserInterface ' )->getMock ())
124
124
;
125
125
$ provider ->expects ($ this ->once ())
126
126
->method ('checkAuthentication ' )
127
- ->willThrowException (new BadCredentialsException ())
127
+ ->willThrowException (new CredentialsExpiredException ())
128
128
;
129
129
130
130
$ provider ->authenticate ($ this ->getSupportedToken ());
0 commit comments