@@ 138-148 (lines=11) @@ | ||
135 | * @test |
|
136 | * @expectedException \UnexpectedValueException |
|
137 | */ |
|
138 | public function authenticateTokenWillFailIfCredentialsAreNotJwtToken() |
|
139 | { |
|
140 | $authenticator = new Authenticator($this->keys); |
|
141 | $anonToken = new PreAuthenticatedToken('foo', ['sub' => 'john'], 'myprovider'); |
|
142 | ||
143 | $userProvider = $this->getMockBuilder( |
|
144 | 'Symfony\Component\Security\Core\User\UserProviderInterface' |
|
145 | )->getMockForAbstractClass(); |
|
146 | ||
147 | $authenticator->authenticateToken($anonToken, $userProvider, 'myprovider'); |
|
148 | } |
|
149 | ||
150 | /** |
|
151 | * @test |
|
@@ 153-160 (lines=8) @@ | ||
150 | /** |
|
151 | * @test |
|
152 | */ |
|
153 | public function supportsPreAuthToken() |
|
154 | { |
|
155 | $authenticator = new Authenticator($this->keys); |
|
156 | ||
157 | $securityToken = new PreAuthenticatedToken('foo', 'bar', 'myprovider'); |
|
158 | $actual = $authenticator->supportsToken($securityToken, 'myprovider'); |
|
159 | $this->assertTrue($actual); |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * @test |