@@ -81,7 +81,7 @@ public function testHandleAuthenticationFailure()
81
81
/**
82
82
* @dataProvider getTokenClearingTests
83
83
*/
84
- public function testHandleAuthenticationClearsToken ($ tokenClass , $ tokenProviderKey , $ actualProviderKey, $ shouldTokenBeCleared )
84
+ public function testHandleAuthenticationClearsToken ($ tokenClass , $ tokenProviderKey , $ actualProviderKey )
85
85
{
86
86
$ token = $ this ->getMockBuilder ($ tokenClass )
87
87
->disableOriginalConstructor ()
@@ -90,12 +90,7 @@ public function testHandleAuthenticationClearsToken($tokenClass, $tokenProviderK
90
90
->method ('getProviderKey ' )
91
91
->will ($ this ->returnValue ($ tokenProviderKey ));
92
92
93
- // make the $token be the current token
94
- $ this ->tokenStorage ->expects ($ this ->once ())
95
- ->method ('getToken ' )
96
- ->will ($ this ->returnValue ($ token ));
97
-
98
- $ this ->tokenStorage ->expects ($ shouldTokenBeCleared ? $ this ->once () : $ this ->never ())
93
+ $ this ->tokenStorage ->expects ($ this ->never ())
99
94
->method ('setToken ' )
100
95
->with (null );
101
96
$ authException = new AuthenticationException ('Bad password! ' );
@@ -115,9 +110,9 @@ public function getTokenClearingTests()
115
110
{
116
111
$ tests = array ();
117
112
// correct token class and matching firewall => clear the token
118
- $ tests [] = array ('Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken ' , 'the_firewall_key ' , 'the_firewall_key ' , true );
119
- $ tests [] = array ('Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken ' , 'the_firewall_key ' , 'different_key ' , false );
120
- $ tests [] = array ('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken ' , 'the_firewall_key ' , 'the_firewall_key ' , false );
113
+ $ tests [] = array ('Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken ' , 'the_firewall_key ' , 'the_firewall_key ' );
114
+ $ tests [] = array ('Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken ' , 'the_firewall_key ' , 'different_key ' );
115
+ $ tests [] = array ('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken ' , 'the_firewall_key ' , 'the_firewall_key ' );
121
116
122
117
return $ tests ;
123
118
}
0 commit comments