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